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

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
cancel
Showing results for 
Search instead for 
Did you mean: 
GregRyder
Contributor III
Contributor III

Backround Colour Expression

Hi

What is the expression if I want the back round Red for Negative values and green for positive values 

Thanks

Greg

Labels (2)
1 Solution

Accepted Solutions
GregRyder
Contributor III
Contributor III
Author

Here is my formula I worked out and it works

if((Sum({<[TXDATE.autoCalendar.YearsAgo]={0}, TCODE={'IN'}, [TXDATE.autoCalendar.Month] ={"<=$(=Num(Month(Today()))) "} >} AMOUNT)
-
Sum({<[TXDATE.autoCalendar.YearsAgo]={0}, TCODE={'CN'}, [TXDATE.autoCalendar.Month] ={"<=$(=Num(Month(Today()))) "} >} AMOUNT))
-
(Sum({<[TXDATE.autoCalendar.YearsAgo]={1}, TCODE={'IN'}, [TXDATE.autoCalendar.Month] ={"<=$(=Num(Month(Today()))) "} >} AMOUNT)
-
Sum({<[TXDATE.autoCalendar.YearsAgo]={1}, TCODE={'CN'}, [TXDATE.autoCalendar.Month] ={"<=$(=Num(Month(Today()))) "} >} AMOUNT)) >0, 'Green', Red())

View solution in original post

1 Reply
GregRyder
Contributor III
Contributor III
Author

Here is my formula I worked out and it works

if((Sum({<[TXDATE.autoCalendar.YearsAgo]={0}, TCODE={'IN'}, [TXDATE.autoCalendar.Month] ={"<=$(=Num(Month(Today()))) "} >} AMOUNT)
-
Sum({<[TXDATE.autoCalendar.YearsAgo]={0}, TCODE={'CN'}, [TXDATE.autoCalendar.Month] ={"<=$(=Num(Month(Today()))) "} >} AMOUNT))
-
(Sum({<[TXDATE.autoCalendar.YearsAgo]={1}, TCODE={'IN'}, [TXDATE.autoCalendar.Month] ={"<=$(=Num(Month(Today()))) "} >} AMOUNT)
-
Sum({<[TXDATE.autoCalendar.YearsAgo]={1}, TCODE={'CN'}, [TXDATE.autoCalendar.Month] ={"<=$(=Num(Month(Today()))) "} >} AMOUNT)) >0, 'Green', Red())