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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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
Partner - Specialist II
Partner - Specialist II

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