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

Announcements
Maximize ROI with Qlik Professional Services – Expert Guidance, Faster Results: Explore Qlik Services
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Period camparison YoY Fiscal Year

Hello,

I want to compare sales figures for this fiscal year (oct 15 - july 16) with sales figures of last fiscal year (oct14- july 15).

I know how to do for calendar year:

     sum({<Year= {$(vLastYear)}}>}Sales) with variable vLastYear= maxYear-1

     sum({<Year= {$(vCurrentYear)}}>}Sales) with variable vCurrentYear= maxYear

I have set fiscal year in script as follows:

SET vFiscalYearStartMonth = 10;

YearName(datum, 0, $(vFiscalYearStartMonth)) AS FiscalYear

When I now make a variable "vLastFiscalYear" as maxFiscalYear-1 and try to make the expression as above, it does not give any result!

1 Solution

Accepted Solutions
miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there a simple correction,


Sum({<FiscalYear= {"$(=YearName(Max(FiscalYear), 0, 10))"}>}Sales)

Sum({<FiscalYear= {"$(=YearName(Max(FiscalYear), -1, 10))"}>}Sales)


Then you can use this expression without problem


Regards,

MB

View solution in original post

4 Replies
sunny_talwar

May be this:

Sum({<FiscalYear= {"$(=YearName(Max(FiscalYear), 0, 10)"}>}Sales)

Sum({<FiscalYear= {"$(=YearName(Max(FiscalYear), -1, 10)"}>}Sales)

susovan
Partner - Specialist
Partner - Specialist

Try this,

Sum({<Year= {"$(vLastYear)"}>}Sales)

Sum({<Year= {"$(vCurrentYear)"}>}Sales)

Warm Regards,
Susovan
miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there a simple correction,


Sum({<FiscalYear= {"$(=YearName(Max(FiscalYear), 0, 10))"}>}Sales)

Sum({<FiscalYear= {"$(=YearName(Max(FiscalYear), -1, 10))"}>}Sales)


Then you can use this expression without problem


Regards,

MB

Not applicable
Author

It works! Thanks Sunny T and Miguel Braga!