Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Red and green color percentage table

Hi

How can I create red color for negative % and green for positive % in following table? Can't seem to manage with proper formula under background formula expression. Thanks

The underlying formulas for V (Volume) and VpM (Volume previous month) are as follows:

V: Sum([#Quantity])

VpM: sum({<Month=, Date={">=$(=monthstart(max(Date),-1))<=$(=monthend(max(Date),-1))"}>} [#Quantity])

%CH: Sum([#Quantity]) / sum({<Month=, Date={">=$(=monthstart(max(Date),-1))<=$(=monthend(max(Date),-1))"}>} [#Quantity])-1

perc2.JPG

1 Reply
shraddha_g
Honored Contributor III

Re: Red and green color percentage table

try in background color:

if(

(Sum([#Quantity]) / sum({<Month=, Date={">=$(=monthstart(max(Date),-1))<=$(=monthend(max(Date),-1))"}>} [#Quantity])-1) <0,red(),green()

)