Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

GetSelectedCount for Date

Hi all,

I'm trying to build a dashboard with a KPI that should show the sum() for the specific date ('2015-05-18')  at the opening of dashboard or when no other date is selected but also if the user select one specific date from the bottom chart it should then show the sum() for that date.

I thought GetSelectedCount would be the easiest way about but and I could get it right for when the specific date(s) are getting selected but it doesnt show the correct amount on the opening of the dashboard and when no date selection is made.

Sum(${<EVENT_DATE={'$(=If(Getselectioncount({'EVENT_DATE'})=0, {'2016-05-18'},{'EVENT_DATE'})'}>}

TOTAL_DISCREPANCY_VALUE_OVER)

Screen Shot 2016-06-23 at 2.02.55 PM.png

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like

=If( GetSelectedCount( EVENT_DATE) =0,

Sum({$<EVENT_DATE={'2016-05-18'} >} TOTAL_DISCREPANCY_VALUE_OVER),

Sum(TOTAL_DISCREPANCY_VALUE_OVER)

)

View solution in original post

4 Replies
swuehl
MVP
MVP

Maybe like

=If( GetSelectedCount( EVENT_DATE) =0,

Sum({$<EVENT_DATE={'2016-05-18'} >} TOTAL_DISCREPANCY_VALUE_OVER),

Sum(TOTAL_DISCREPANCY_VALUE_OVER)

)

Anonymous
Not applicable
Author

Hi,

If you would like to show only the data with EVENT DATE={'2016-05-18'} , irrespective of selection ,?

try this ??

Sum(1{<EVENT_DATE={'2016-05-18'}>} TOTAL_DISCREPANCY_VALUE_OVER)

Not applicable
Author

It works

Thank you Swuehl!

swuehl
MVP
MVP

If you want to use dollar sign expansion and a single aggregation function, you could also try (note that I've used two single quotes around the date literal as escape sequence):

Sum({$ $(=If( GetSelectedCount( EVENT_DATE) =0, '<EVENT_DATE={''2016-05-18''} >','')) } TOTAL_DISCREPANCY_VALUE_OVER)