Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
LEGION
Contributor II
Contributor II

Colour in Expression

Hello, I am trying to use the following in "Value Colour" for my expression.

The problem is the colour is not correct, if the answer is > 0 it should show in green however it shows red, but if i filter the data sometimes it shows correctly in green when > 0

The formula I'm using:

=If(

 

((((Sum({<[TXDATE.autoCalendar.InMTD] = {'1'},[TXDATE.autoCalendar.YearMonth] = {'$(=$(vCurrentMonth))'},[TCODE]={'IN'}>} AMOUNT))
-
(Sum({<[TXDATE.autoCalendar.InMTD] = {'1'},[TXDATE.autoCalendar.YearMonth] = {'$(=$(vCurrentMonth))'},[TCODE]={'CN'}>} AMOUNT)))
-
((Sum({<[TXDATE.autoCalendar.InMTD] = {'1'},[TXDATE.autoCalendar.YearMonth] = {'$(=$(vLYCurrentMonth))'},[TCODE]={'IN'}>} AMOUNT))
-
(Sum({<[TXDATE.autoCalendar.InMTD] = {'1'},[TXDATE.autoCalendar.YearMonth] = {'$(=$(vLYCurrentMonth))'},[TCODE]={'CN'}>} AMOUNT))))
/
((Sum({<[TXDATE.autoCalendar.InMTD] = {'1'},[TXDATE.autoCalendar.YearMonth] = {'$(=$(vLYCurrentMonth))'},[TCODE]={'IN'}>} AMOUNT))
-
(Sum({<[TXDATE.autoCalendar.InMTD] = {'1'},[TXDATE.autoCalendar.YearMonth] = {'$(=$(vLYCurrentMonth))'},[TCODE]={'CN'}>} AMOUNT))))

 

>'0%','GREEN','RED',)

Labels (1)
1 Solution

Accepted Solutions
anat
Master
Master

Or else use num function to make proper format

View solution in original post

4 Replies
anat
Master
Master

Can you try by removing '%', try like >'0'

LEGION
Contributor II
Contributor II
Author

I have tried with

>0

&

>'0'

but no change

anat
Master
Master

First check the expression output format in text object then try to use same in if condition

anat
Master
Master

Or else use num function to make proper format