Qlik Community

Qlik Sense App Development

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

Highlighted
manuprakash2019
New 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
wandererroch
New Contributor III

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

 

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

 

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

manuprakash2019
New Contributor

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

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

 

wandererroch
New Contributor III

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

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