Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have data for 13 weeks having week id from 1 to 13.
I want to calculate rolling 4 weeks volume and growth.For this I know to calculate the rolling 4 weeks(Which include week 13,12,11,10) on expression level.
The solution ,I am looking to calculate flags for Current rolling 4 weeks((wk id=13,12,11,10)) and past rolling 4 weeks(wk id=9,8,7,6)
in the script .Instead of calculating them om expression.
Can anyone tell me how to do this in script?
Regards,
Mayank
if you already have the week id
match(weekid, 13, 12, 11, 10) as flagcurrent
match(weekid, 9, 8, 7, 6) as flagpast
if you already have the week id
match(weekid, 13, 12, 11, 10) as flagcurrent
match(weekid, 9, 8, 7, 6) as flagpast
Hi Maxgro,
Thank you for reply..
When I am writing below code in script :
Time:
LOAD WEEK_ID,
if(WEEK_ID= match(WEEK_ID, 5, 6, 7, 😎 ,1,0) as flagpast,
if(WEEK_ID= match(WEEK_ID, 1, 2, 3, 4),1,0) as flagcurrent,
WEEK_DT,
Getting below values for both the fields:
Why only 0 value for flag past?:Why this behaviour?
Regards,
Mayank
Week:
load rowno() as WEEK_ID
AutoGenerate 13;
Time:
LOAD
WEEK_ID,
if(match(WEEK_ID, 9, 8, 7, 6),1,0) as flagpast,
if(match(WEEK_ID, 13, 12, 11, 10),1,0) as flagcurrent
Resident Week;