Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
zwyne
Creator
Creator

Period Comparison

Hi there,

I have defined my period  comparison as follows:

 vSetMTD     :              Year={'$(vMaxYear)'},Month={'$(vMaxMonth)'},Day='<=$(vMaxDay)'},Date=,MonthYear=
 
 vSetPreviousMonth         Year={'$(vPriorMonthYear)'},Month={'$(vPriorMonth)'},Day={'<=$(vMaxDay)'},Date=,MonthYear=
 
When I use it like below it works fine
count({$<Flags={'MajFlag'},Year={'$(vMaxYear)'},Month={'$(vMaxMonth)'},Day={'<=$(vMaxDay)'},Date=,MonthYear=>}Flags)
 
But  when I try to use it like 
count({$<Flags={'MajFlag'},$(vSetMTD)>}Flags) it throws an error. Similarly for the vSetPreviousMonth  
 
How can I make this to work so that I have to always write:  Year={'$(vPriorMonthYear)'},Month={'$(vPriorMonth)'},Day={'<=$(vMaxDay)'},Date=,MonthYear=
 
Thanks
2 Replies
dplr-rn
Partner - Master III
Partner - Master III

What do you mean by it throws an error? An error in editor?
if you put set analysis expression in variable e.g. vSetMTD sometimes the expression editor shows error but it works

try making the entire set as 1 variable. you will get a error message in editor but it works
e.g.
count({<$(vSetAnalysis)>}Flags)