Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Adrielmf2
Contributor
Contributor

Condition Color in Simple KPI

Hallo,

 

Im trying to do a conditional color, and Im getting allways only one color. I put the same If as a dimension and i get the corret value, but the color doesnt work.

 

Adrielmf2_0-1648499646144.png

 

Labels (2)
4 Replies
bgl-sjoyce
Partner - Contributor III
Partner - Contributor III

what is your if-statement.  you aren't actually returning #green or #red right?  it should be hex color code in single quotes or qlik function (green(), red()) not in single quotes.

I'm guessing your function is invalid and is just returning what you manually picked .

Adrielmf2
Contributor
Contributor
Author

Its not invalid. I just put the string in a Dimension to see if the logic works. 

if(BusinessHrs<sum(ValorMeta),'#7CFC00','#FF0000')

 

The other one is the same, but with the string

if(BusinessHrs<sum(ValorMeta),'#green','#red')

stevejoyce
Specialist II
Specialist II

did you try 

if(BusinessHrs<sum(ValorMeta),green(),red())

like i said, #green or #red is not going to actually change your color.  

 

Your first expression assuming BusinessHrs<sum(ValorMeta) is correct.

Adrielmf2
Contributor
Contributor
Author

Yes, I tried if(BusinessHrs<sum(ValorMeta),green(),red()).

 

Like I said, i just put the string in the if to see if it was evaluating correctly, and it is. But in the color expression, doesnt work