Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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
MVP
MVP

Re: GetSelectedCount for Date

Maybe like

=If( GetSelectedCount( EVENT_DATE) =0,

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

Sum(TOTAL_DISCREPANCY_VALUE_OVER)

)

4 Replies
MVP
MVP

Re: GetSelectedCount for Date

Maybe like

=If( GetSelectedCount( EVENT_DATE) =0,

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

Sum(TOTAL_DISCREPANCY_VALUE_OVER)

)

galax_allu
Valued Contributor

Re: GetSelectedCount for Date

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

Re: GetSelectedCount for Date

It works

Thank you Swuehl!

MVP
MVP

Re: GetSelectedCount for Date

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)