Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculation Prior Year by selected Month

Hi Guys,

Please help me..

How to write script, if I want to see prior year by selected Month.

for example:

If I click Year 2014 and Month May then Summary Jun12-May13

If I click Year 2014 and Month April then summary May12-Apr13

and I've script YTD : sum({<YEAR=, MONTH=, DATE={">=$(MonthStart(Max(Date),-11))<=$(=Max(Date))"},[Field].

Thanks for help.

Regards.

Labels (1)
2 Replies
Not applicable
Author

Somebody help me... (T_T)....

Not applicable
Author

Hello Valdi,

I guess you want sum(one-year data) of prior year of current selection, and the following one works.

=sum({$1 <Year={'<=$(=(max(Year)-1))'}, Month=,[Date] = {'<=$(=AddYears(max([Date]),-1))>=$(=Addmonths(max([Date]),-23))'}>} [Field])