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

Set Analysis last year calculation syntax

Hi i have the following expression in my Qv Doc.

=num(sum({$<FY = {$(=max(FY))}, Year=,Quarter=, YearMonth = {"<=$(=max(YearMonth))"},Month= >} Nettobelopp), '$#,##0;($#,##0)')

i would like to find the values  - 1 year to measure against.

my syntax however seems wrong,

any help is greatly appreciated.

=num(sum({$<FY = {$(=max(FY)-1)}, Year=,Quarter=, YearMonth = {"<=$(=max(YearMonth))"},Month= >} Nettobelopp), '$#,##0;($#,##0)')

1 Solution

Accepted Solutions
nirav_bhimani
Partner - Specialist
Partner - Specialist

You can also try this with the month number,

=sum({$<Year=, Year={$(=max(Year)-1)},MonthNumber={$(=max(MonthNumber))}>}Nettobelopp)

Regards,

Nirav Bhimani


View solution in original post

3 Replies
stephencredmond
Luminary Alumni
Luminary Alumni

Hi,

The calculation for the FY is OK, the problem is that you are also calculating the YearMonth.  You will need to perform a calculcation that returns the correct YearMonth that you want for last year.

Regards,

Stephen

Stephen Redmond is author of QlikView for Developer's Cookbook

He is CTO of CapricornVentis a QlikView Elite Partner. We are always looking for the right people to join our team.

Follow me on Twitter: @stephencredmond

nirav_bhimani
Partner - Specialist
Partner - Specialist

Try this,

Last Year:

Num(Sum({<FY = {"$(=Max(FY)-1)"}, Quarter=,Year=, Month= >} Nettobelopp) , '$#,##0;($#,##0)')

Last Year Month i.e  July-2012

=Sum({<Year=, MonthYear=, Month=, Quarter=, CalDate={'>=$(=MonthStart(Max(CalDate), -12))<=$(=MonthEnd(Max(CalDate), -12))'}>} Nettobelopp)

Regards,

Nirav Bhimani

nirav_bhimani
Partner - Specialist
Partner - Specialist

You can also try this with the month number,

=sum({$<Year=, Year={$(=max(Year)-1)},MonthNumber={$(=max(MonthNumber))}>}Nettobelopp)

Regards,

Nirav Bhimani