Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Wanted to Display the month label in different color

Hello Everyone,

I wanted to display the month label color based on the condition,

for past months the label test color should be in one color, for future months that should be different,

Can anybody tell how to do this,

Thanks

12 Replies
its_anandrjs

Hi,

Try like this in any text or label

If(Month  = Max( Month ( Today() ) ), Red(), Green())

Regards

Anand

Not applicable
Author

Hello Anand,

Thanks for the response

But it is not working,

jagan
Luminary Alumni
Luminary Alumni

Hi,

It is not possible for header, but you do this for the expression values like below

If you derived month column using Date() or Month() then try like this

Chart Properties -> Expressions-> Select Expression and expand + icon -> Select Background Color and give below expression

If(Month  = Month(Today()), RGB(0, 0, 255), If(Month  > Month(Today()), RGB(255, 0, 0), RGB(0, 255, 0)))


Note : Both Month(Today()) and your Month field values should be in the same format.


Hope this helps you.


Regards,

jagan.



SunilChauhan
Champion II
Champion II


Chart Properties -> Dimension-> Select dimension and expand + icon -> Select Text Color and give


If(Month  = Month(Today()), RGB(0, 0, 255), If(Month  > Month(Today()), RGB(255, 0, 0), RGB(0, 255, 0)))


hope this helps

Sunil Chauhan
jagan
Luminary Alumni
Luminary Alumni

Hi,

Yes it is working, by mistake I given expression instead of Dimension.

Regadrs,

jagan.

its_anandrjs

Hi,

the above expression for charts only or any text object it will not for caption label of the chart you can use the below expression in any expression by pressing Plus(+) sign and apply the expression there.

If(Month  = Max( Month ( Today() ) ), Red(), Green())


Regards

Anand

Not applicable
Author

Thanks Jagan,

When i am using this condition in the table, it is working, but it is not working with the charts,

any settings we need to change at charts.

Thanks

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you are using this in charts then try like this

Chart Properties -> Expressions-> Select Expression and expand + icon -> Select Background Color and give below expression

If(Month  = Month(Today()), RGB(0, 0, 255), If(Month  > Month(Today()), RGB(255, 0, 0), RGB(0, 255, 0)))



In charts you won't have headers so this color logic is applicable for Bars, Lines, Bubbles etc.


Regards,

Jagan.

SunilChauhan
Champion II
Champion II

chart properties->axes-> dimension axis> font

type code here

Sunil Chauhan