# QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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
Contributor III

## Re: Set Analysis last year calculation syntax

You can also try this with the month number,

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

Regards,

Nirav Bhimani

3 Replies
Valued Contributor II

## Re: Set Analysis last year calculation syntax

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.

Contributor III

## Re: Set Analysis last year calculation syntax

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

Contributor III

## Re: Set Analysis last year calculation syntax

You can also try this with the month number,

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

Regards,

Nirav Bhimani