Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Scripting

Hi All,

Can anyone tell me how to calculate privious 12 months sales in script.

2 Replies
oscar_ortiz
Partner - Specialist
Partner - Specialist

You're going to have to be a bit more specific if you want any help with this...

Anonymous
Not applicable
Author

Kushal,

When creating my calendar table in my script, I usually have a line like this that creates a flag.

IF(TempDate >=ADDMONTHS(MonthStart($(varToday)),-11),1,0) AS Current12MonthFlag,

Then you can use set analysis to only pull sales for that flag:

SUM({<Current12MonthFlag={1}>}Sales)

Hope this helps!