Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ajinkyabhonsle
Contributor III
Contributor III

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

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

 

 

Channa
jonathandienst
Partner - Champion III
Partner - Champion III

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

LANDING_PAGE_SECTION = {"*developers*"}, 

 

i think hear he need to use LIKE

Channa