Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
sunny_talwar

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
Specialist II
Specialist II

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.

Anonymous
Not applicable
Author

Thanks for the solution. It works !