Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

nguyendeana
New Contributor

count and set analysys does not work

I have been stuck at this issue for days.  I hope you can point me to the right direction of how to solve it.

I need to get a count of “New” Users in the system per month/year.  Every time a user logon a row will be added to the below table.

Example: Let said User A logon on 4/1/2017,   4/3/2017, 6/2/2017  then the count will be one for April 2017 and zero for the rest of the year (including June 2017)


This works:

if([ACTIVITY_DATE.autoCalendar.Date]= date($(FirstLogOnDate)), 'New', 'Old')

but this does NOT work, why ?

count ( {$<[ACTIVITY_DATE.autoCalendar.Date] = date($(FirstLogOnDate)) >} USER_ID)

This does not work either:

                  count ( {$<[ACTIVITY_DATE.autoCalendar.Date] = {‘$(=FirstLogOnDate)’}>} USER_ID)

where variable  FirstLogOnDate is:

Min(total<USER_ID> [ACTIVITY_DATE.autoCalendar.Date], USER_ID)

Thanks

3 Replies

Re: count and set analysys does not work

Set analysis is evaluated once per chart, but it seems that you are looking for the count based on individual user's min date... this won't work with set analysis, may be try this

FirstSortedValue(Aggr(Count(USER_ID), USER_ID, [ACTIVITY_DATE.autoCalendar.Date]), Aggr([ACTIVITY_DATE.autoCalendar.Date], [ACTIVITY_DATE.autoCalendar.Date], USER_ID))

dwforest
Valued Contributor

Re: count and set analysys does not work

Set analysis is computed once per chart, so the min will not be re-evaluated for the current user in each row.

Easiest way is to use the if statement during the load to set a flag and then set analysis on that flag.

nguyendeana
New Contributor

Re: count and set analysys does not work

Thanks for the solution. It works !

Community Browser