Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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
Thanks for sharing the link, I followed it and it worked great!!