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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression in Set Analysis using the Dimension

Hi,

I have been trying to write a simple Set Expression to check the increase in the number of  distinct users on a daily basis.I have attached a Qlikview file where I want to do whats done in Exp2 in a more simplified way. I tried writting Exp1 but it does not work, so I was wondering I was doing wrong.

Exp1: (does not work)

COUNT(DISTINCT {<Day = {"<=$(Only(Day))"}>} User)

Exp2: (Works, but I don't want to hard code the Day and Day range could increase.

if(Day = 1, Count({<Day={'<=1'}>}TOTAL DISTINCT User),

     if(Day = 2, Count({<Day={'<=2'}>}TOTAL DISTINCT User),

          if(Day = 3, Count({<Day={'<=3'}>}TOTAL DISTINCT User),

               if(Day = 4, Count({<Day={'<=4'}>}TOTAL DISTINCT User),

                    if(Day = 5, Count({<Day={'<=5'}>}TOTAL DISTINCT User)

)))))


Thanks in Advance!

2 Replies
swuehl
MVP
MVP

This blog post could be of interest, it discusses how you can use a dimension value for set analysis (like you already use it), but also suggests how to create the expression needed in the script, automatically:

http://community.qlik.com/docs/DOC-1335

Regards,

Stefan

Not applicable
Author

Thanks for sharing the link, I followed it and it worked great!!