Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
christianeatman
Contributor
Contributor

GetSelectedCount with sumif

Hi,

I am trying to display a KPI for a certain year if no selection is made in the year filter. Specifically, I want to show the sum of an amount for the year 2018 if no selection is made. It seems from my research that GetSelectedCount would allow me to do this. This is what I tried, but does not work:

sum(if(GetSelectedCount([Sheet1.Year]=0) and{<[Sheet1.Year]={2018}>}),Amount)

I have tried this expression in various forms (different placement of commas, different placement of parentheses, placing the sum in a different place), but nothing has worked. Is it possible to accomplish what I want using GetSelectedCount? If not, are there other ways to do this?

Thanks!

11 Replies
sunny_talwar

Try this

If(GetSelectedCount([Sheet1.Year]) = 0, Count({<[Sheet1.Year] = {2018}>}[Emplid])/Count({<[Sheet1.Year] = {2018}>}EMPLID_PIT), Count([Emplid])/Count(EMPLID_PIT))

christianeatman
Contributor
Contributor
Author

That works.  I really appreciate you guys' help!