Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
lee_
Contributor
Contributor

getselectioncount issue

Hi All, 

I'm trying to understand the quantity of months selected through a filter using 

=GetSelectedCount(MonthShortname)

This works fine if i select on filter with just monthshortname as the dimension and I'll get a value 0 - 12

but if i use a formula as the filter dimension 

If(Match([_CYTD_flag],'1') or Match([_PYTD_flag],'1'), MonthShortname)

regardless of how many months i select , the get count remains at zero

What am i missing here, im still selecting months?

 

thanks

 

 

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

You are not selecting a native field with your calculated dimension and therefore getselectedcount() couldn't work. To get the count you may calculate it with:

count({<_CYTD_flag={1}>+<_CYTD_flag={1}>} distinct MonthShortname)

- Marcus

View solution in original post

3 Replies
vinieme12
Champion III
Champion III

Try below

 

Aggr( only({<_CYTD_flag={1}>+<_CYTD_flag={1}>}MonthShortname),MonthShortname)

 

or

Aggr(If([_CYTD_flag=1 or _PYTD_flag=1, MonthShortname),MonthShortname)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
marcus_sommer

You are not selecting a native field with your calculated dimension and therefore getselectedcount() couldn't work. To get the count you may calculate it with:

count({<_CYTD_flag={1}>+<_CYTD_flag={1}>} distinct MonthShortname)

- Marcus

lee_
Contributor
Contributor
Author

With the top solution you potenitally lose visability of the months in the dropdown when selected, but a neat solution. So in this situation Marcus solution worked better - 

thanks both