Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression inside a set expression

I have a set expression which returns the number of employees fulfilling the below criteria

=Count (Distinct {$<Rundate={$(vRundate)}, Maxdate={'<$(vMaxdate)'} >} EmpID)

where vRundate is 201401 and vMaxdate is 201408

Now my query is that i want to put this in a chart where my dimension will be Month and vRundate and vMaxdate will change based on Month.

Right now its a variable and can store only one value at a time but since my chart will have Month as dimension and it will have values from Jan-Aug so my variable value should change for every month as highlighted in the table below.

MonthvRundatevMaxdate
Jan201401201402
Feb201402201403
Mar201403201404
Apr201404201405
May201405201406
Jun201406201407
Jul201407201408

How can i do this ? Can we write expression inside a set expression and pass values of Rundate and Maxdate like Rundate= Max(Month)+1 or simething like this ?

Thanks a lot in advance,

Sumit

13 Replies
Not applicable
Author

Ok!

Not applicable
Author

Hi Gauarv,

I don't understand whatever you are saying. Could you please explain with an example.

Thanks a lot,

Sumit

sasikanth
Master
Master

Hi

If you have two date fileds

then you can write the expression like

count({<rundate ={'$(=max(Left(date(rundate,'YYYYMMDD'),6))+1)'} ..... EMP_ID)

Not applicable
Author

What i'm trying to say is while defining your variables i.e. vRundate and vMaxdate, do not write a specific value like you have given which is 201401 and 201408. Instead give an expression which will take automatically the selected month or months into consideration and while doing it do not precede your variable expression with an '=' sign.