Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I have a KPI below which is displaying "Records Returned" and expression I used is following:
Count(distinct[Project Code])
My requirement is to display " Records Returned " only if there is any or multiple selections in several filters been applied otherwise KPI should display zero. Filters on the app are "Country cd" , "State cd", "City Cd", "Region Cd" , "Assigned Officer" etc. and may be few more going forward.
How can we achieve that?
Thanks,
ZJ
Yes. Sorry for delay in reply. 🙂
Just put 0 in else part of If.
If( len(trim(GetCurrentSelections()))>0, Count(distinct[Project Code]), 0 )
Hope that solves your question.
Hello,
You can use condition like below.
If(GetsSelectedCount(Country cd) + GetsSelectedCount (State cd) +
GetsSelectedCount (City cd) > 0, Count(distinct[Project Code])
)
Thanks,
Ashutosh
Sorry this expression is not working. Is this a qlik sense function? I am using qlik sense.
Its GetSelectedCount().
Sorry for the typo
Yes now it worked but the problem is if I will have 15 more filters then I will need to add all those in the expression like +GetsSelectedCount (Region) and so on. We have 15 reports and each report has 25-30 filters on that.
Is there not a way that no matter which filter we apply from the report "Records Returned" gets displayed otherwise shows zero?
Ok. You can try this
If( len(trim(GetCurrentSelections()))>0, Count(distinct[Project Code]) )
Great this works perfect. One last question, with this code when there is no selection it displays like below
Can we display 0 instead - ?
Thank you so much for the help.
No worries I got that working.
Thank you so much for the help.
Yes. Sorry for delay in reply. 🙂
Just put 0 in else part of If.
If( len(trim(GetCurrentSelections()))>0, Count(distinct[Project Code]), 0 )
Hope that solves your question.
Yes. Thank you!