Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

The same period in prior year

Good day!

In my model i have fields Year, YearWeek.

Also in pivot table there is expression , which calculate sum of volume for current selection

In second expression i need to calculate sum of volume for same period, but with prior year.

For example:

1. if i select Year 2014, second expression ,must calculate for Year 2013

2. if i select YearWeek 201301,201302,201303, second expression ,must calculate for 201201,201202,201203

Thank you!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See the example I posted in this discussion: http://community.qlik.com/message/313488#313488


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
datanibbler
Champion
Champion

Hi,

try using the Addmonths() function and Getfieldselections(). That should help.

Best regards,

DataNibbler

Gysbert_Wassenaar

See the example I posted in this discussion: http://community.qlik.com/message/313488#313488


talk is cheap, supply exceeds demand
krishna20
Specialist II
Specialist II

Hi,

you are trying for to calculate YTD and LYTD.

for YTD

Sum({<Year = {$(vCurrentYear)}>}Revenue).

For LYTD

Sum({<Date_Field={">=$(=Date(YearStart(Max(Date_Field),-1))) <=$(=Date(addyears(Max(Date_Field),-1))) "}>}Revenue)

Regards

Krishna

Anonymous
Not applicable
Author

Thanks, it's the similar with my task.