Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

andreyfcdk91
New Contributor III

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

Re: The same period in prior year

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


talk is cheap, supply exceeds demand
4 Replies
datanibbler
Esteemed Contributor

Re: The same period in prior year

Hi,

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

Best regards,

DataNibbler

Re: The same period in prior year

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


talk is cheap, supply exceeds demand
krishna20
Valued Contributor

Re: The same period in prior year

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

andreyfcdk91
New Contributor III

Re: The same period in prior year

Thanks, it's the similar with my task.

Community Browser