Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

KPI Color for 3 conditions : Issue with red color "-" hypen

Hi there, 

Please help me in figuring out the below issue.

RED HYPHEN '-' when no items selected on the filter

Scenario:

1) When no items selected on the filter, the KPI box should have Gray hyphen '-'.

2) If anyone of the items selected from the filter, based on the sign of the value, it should display either Red or Green colour.

i.e

for a value less than 0 it should be Red

and for a value greater than 0 it should be Green

and for no value, it should be Gray hypen -

 

Please see what I did so far.

Written condition on KPI Box :    if(GetSelectedCount(Campaigns)=0,'-',[B]-[A])

In conditional colour:

Written condition like this: =  if([B]-[A]<0,Red(),Green())

 

Please help me to fix Red hyphen issue here

 

 

 

 

 

 

 

 

Labels (1)
3 Replies
Contributor III
Contributor III

 

looks like it's doing a text compare instead of numeric.  try this:

 

if(GetSelectedCount(Campaigns)=0,gray(),if([B]-[A]<0,Red(),Green()))

Highlighted
Contributor
Contributor

Thanks for the reply @wandererroch  but, still I couldn't see a grey hyphen. Instead I am getting 4,290,822,336.00

 

Highlighted
Contributor III
Contributor III

That's what you get when using the expression for your coloring?