Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
ajinkyabhonsle
New Contributor II

Previous year set expression not working

Hi All,

I am new to qliksense. I am trying to calculate set analyis for previous year vs current year:

The below previous year expression does not seem to work and gives me the same result as Current Year

Previous Year:

sum({<LANDING_PAGE_SECTION = {"*developers*"},FiscalYearID +={"$(Max(FiscalYearID)-1)"}>}SESSIONS) 

Can you tell me where I am going wrong here? However my current year expression works perfectly fine. its just when I enter '-1' in the expression it does not work. 

For your information FiscalYearID has values = 2018,2019,2020 etc....

Regards,

Ajinkya

 

3 Replies
Channa
Contributor III

Re: Previous year set expression not working

sum({<LANDING_PAGE_SECTION = {"*developers*"},FiscalYearID ={$(= max(FiscalYearID -1))}>}SESSIONS) 

 

 

Channa
MVP
MVP

Re: Previous year set expression not working

Are you making the year selection in the field FiscalYearID, or are you selecting in a another field and relying on Max(FiscalYearID) to give the correct results? Then you need to override that year selection in the set expression. Lets say that you selected field "Year":

sum({<LANDING_PAGE_SECTION = {"*developers*"}, FiscalYearID = {"$(=Max(FiscalYearID)-1)"}, Year>} SESSIONS)
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Channa
Contributor III

Re: Previous year set expression not working

LANDING_PAGE_SECTION = {"*developers*"}, 

 

i think hear he need to use LIKE

Channa