This content has been marked as final.
Show 9 replies

1. Re: How to calculate 4 week average
Marc MOUSSA Nov 7, 2016 3:16 PM (in response to Claire Chen)You want this to show in a second column on the right ?

2. Re: How to calculate 4 week average
Claire Chen Nov 7, 2016 4:20 PM (in response to Marc MOUSSA)I want to show value under 4 week forecast column in the first picture. It's all 0 now because my calculation is wrong.

3. Re: How to calculate 4 week average
Shinichiro Murakami Nov 7, 2016 4:33 PM (in response to Claire Chen)
4 weeks avg SM_9.2.twbx 23.4 KB


4. Re: How to calculate 4 week average
Claire Chen Nov 7, 2016 5:21 PM (in response to Shinichiro Murakami)It will work if it's by week but I'm going to put 4 weeks forecast average by model.
Thanks!

5. Re: How to calculate 4 week average
Shinichiro Murakami Nov 7, 2016 6:14 PM (in response to Claire Chen)Follow the illustrations.
[BpWW 2]
if [Param WW]>=([Bp Ww]1) then [Bp Ww] end
last()
if [Param WW]>=attr([Bp Ww]) then last() end
[4 Weeks Avg]
(window_sum(if [last()]<=5 and [last()]>=2 then sum([Value]) end))/4
Thanks,
Shin

4 weeks avg SM_9.2 V2.twbx 43.0 KB


6. Re: How to calculate 4 week average
Claire Chen Nov 8, 2016 4:02 PM (in response to Shinichiro Murakami) 
7. Re: How to calculate 4 week average
Shinichiro Murakami Nov 8, 2016 4:06 PM (in response to Claire Chen)1 of 1 people found this helpful 
8. Re: How to calculate 4 week average
Claire Chen Jan 16, 2017 5:59 PM (in response to Shinichiro Murakami)Hi Shin,
Thank you so much for the reply. End up I added this calculation in Alteryx.
Thank you again.
Claire

9. Re: How to calculate 4 week average
Shinichiro Murakami Jan 16, 2017 7:14 PM (in response to Claire Chen)Then, could you mark my answer as correct.
Thanks,
Shin