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.
awadah25
Contributor II

Color Measures

My requirement is an equation for pivot table to change the color to red when the date is expired and green if it is valid

12 Replies
ecolomer
Honored Contributor II

Re: Color Measures

awadah25
Contributor II

Re: Color Measures

I need expression for date please, like:

green color = 2 months or above

red color = expired

yellow color = 1 month or less

Re: Color Measures

Try like below from BG color

If(date=expired, Green(), Red())

Life is so rich, and we need to respect to the life !!!
awadah25
Contributor II

Re: Color Measures

I need the system to know that the date is expired

Re: Color Measures

Can you come up with dataset. It would better if you explained more with data

Life is so rich, and we need to respect to the life !!!
vinodkumark
New Contributor

Re: Color Measures

Hi Dastan,

Use below expression,

=if($(vMonthValid)>=60,$(vGoodcolour_Green),if($(vMonthValid)<=30,$(vYellowColur),$(vBadColour_Red)))

Where vMonthValid = Date(Today())-Date(Date_Column)

          ,vGoodcolour_Green = Green()

          ,vYellowColur = Yellow()

          ,vBadColour_Red = Red()

Or you can use the Satement like RGB(64,128,115) to the the color value to variables.

Note: I have considered '>= 2months' means >=60days, '<=1month' means <=30days and all other conditions will come under Expired Date

mayuresh_d
Contributor

Re: Color Measures

yes, please rolf come up with data set that will help us to solve ur problem.

awadah25
Contributor II

Re: Color Measures

Find attached database please

laddu_927
Valued Contributor

Re: Color Measures

click on the '+' beside your expression in expressions tab and there you can write expressions to give colours to background, text etc. There you can use any if else clause to define the colours.