Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ElectricBoogaloo
Contributor
Contributor

Set analytic help

Hello,

Im working on a Qlik sense app which contains three different data sets, with different dates.

Right now my  KPI's are hard coded to show the newest date with the following expression

=count(if([Date-Sheet-3.Date]= '06/06/2019',if([Sheet-3.Risk]='High Risk', [Conflict Description-Sheet-3.Conflict Description])))

But of course the KPI's look terrible and just display '0' when i choose to look at another date.

So what i really want is to have a KPI that could show "06/06/2019" as a default selection, but still be able to show the information from the two other dates if chosen.

as a starting point I created this expression

=Count({<[Sheet-3.Risk]={"High Risk"}>}[Conflict Description-Sheet-3.Conflict Description])

But it returns completely wrong data, and i honestly dont know why.

Im fairly new to Qlik, and if anyone can help it would be greatly appreciated

 

1 Solution

Accepted Solutions
Uday_Pasupuleti
Partner - Creator III
Partner - Creator III

Try
If(GetSelectedCount([Date-Sheet-3.Date])=0,Count( {<[Date-Sheet-3.Date]= {'06/06/2019'},[Sheet-3.Risk]={'High Risk'}>}[Conflict Description-Sheet-3.Conflict Description]),Count({<[Sheet-3.Risk]={'High Risk'}>}[Conflict Description-Sheet-3.Conflict Description]))

View solution in original post

4 Replies
Uday_Pasupuleti
Partner - Creator III
Partner - Creator III

Try
If(GetSelectedCount([Date-Sheet-3.Date])=0,Count( {<[Date-Sheet-3.Date]= {'06/06/2019'},[Sheet-3.Risk]={'High Risk'}>}[Conflict Description-Sheet-3.Conflict Description]),Count({<[Sheet-3.Risk]={'High Risk'}>}[Conflict Description-Sheet-3.Conflict Description]))

ElectricBoogaloo
Contributor
Contributor
Author

Hmm i read the code it makes sense, and it works on some of my other KPI's with the same problem, but using different data. So thanks for that!

So i guess there might something wrong with how the data is linked
ElectricBoogaloo
Contributor
Contributor
Author

Nvm it works -
Changed your so expression from

If(GetSelectedCount([Date-Sheet-3.Date])=0,Count( {<[Date-Sheet-3.Date]= {'06/06/2019'},[Sheet-3.Risk]={'High Risk'}>}[Conflict Description-Sheet-3.Conflict Description]),Count({<[Sheet-3.Risk]={'High Risk'}>}[Conflict Description-Sheet-3.Conflict Description]))

to

If(GetSelectedCount([Date-Sheet-3.Date])=0,Count( {<[Date-Sheet-3.Date]= {'06/06/2019'},[Sheet-3.Risk]={'High Risk'}>}[Sheet-3.Risk]),Count({<[Sheet-3.Risk]={'High Risk'}>}[Sheet-3.Risk]))

Uday_Pasupuleti
Partner - Creator III
Partner - Creator III

I have given you the logic so that you can change the field names accordingly..

Good to see it worked..