Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
LinusNandin
Contributor
Contributor

Set analysis with dimension min as input to set function

Hello!

 

The expression is supposed to count the number of sessions for the 30 first days for each app, and add them together. The apps have different start dates.

I have the following expression:

sum(
          aggr(
                  count(
                          {<[Session Start] = {"<=$(=Date(min([Session Start]) + 30))"}>}
                          [Session Count]
                          )
                  ,[App name]
                  )
          )

Currently the function  min([Session Start]) returns the minimum date for all the "App names"

I need help to get the min([Session Start]) to return the minimum date corresponding to each app

4 Replies
rubenmarin

Hello!

Set analysis is calculated before the table, not applied ro by row, neither inside of an aggr for each dimension.

Not efficient but maybe:

sum(
  aggr(
    count(
      If([Session Start]<=min(TOTAL <[App name> [Session Start])+30)                     
        ,[Session Count])
    )
  ,[App name],[Session Start]
  )
)

To be more efficient you can calculate this in script with the help of mapping table and resident loads.

LinusNandin
Contributor
Contributor
Author

Thanks for the replay. 

Does not seem to work. I get 0.

I'm working on it in the load script too. I do not currently have access to the data connection, thats why i've tried it in chart expression 

 

 

rubenmarin

Hi, there was a typo:

min(TOTAL <[App name]> [Session Start])

If still doesn't works, can you upload a sample dummy data/app to make some tests?

LinusNandin
Contributor
Contributor
Author

Hi!

I did realize the typo and corrected it. 

This is want.

LinusNandin_0-1644865404765.png