Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to change text color according to date?

Hi there,

Anyone know how to change the test objects or table headers according to date?

thanks! in advance.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Go to Properties of Text Box

Select Color under Background section

Use Calculated under base color and write below expresssion

IF(WeekDay(Today()) = 'Mon', Green(),

IF(WeekDay(Today()) = 'Tue', Red(),

IF(WeekDay(Today()) = 'Wed', Blue(),

IF(WeekDay(Today()) = 'Thu', QlikTechGray(),

IF(WeekDay(Today()) = 'Fri', QlikTechBlue(),

IF(WeekDay(Today()) = 'Sat', RGB(100,100,100),

RGB(120,120,120)))))))

View solution in original post

6 Replies
MK_QSL
MVP
MVP

Can you please elaborate little more on your requirements?

Anonymous
Not applicable
Author

for text colour you can goto tab expressions, click on your expressiom and click to plus

then yo ucan define Text color with if conditions

if date < today, rgb,128,128,128), rgb(255,255,255)

same for table header you can define depending ondate different texts (but not colour)

manojkulkarni
Partner - Specialist II
Partner - Specialist II

can you explain more abt requirement ? on change of date text color can be changed by using HRLinder

logic. but it is bit difficult to write logic for each date.

Not applicable
Author

yeah of course I want something like

in a year 54 weeks so my Test Object's color have to change according to the weeks or days in a week

Eg:

Monday = blue

Tuesday = red

Thursday = green

else

Week1 = black

Week2 = yellow

Week3 = Pink

MK_QSL
MVP
MVP

Go to Properties of Text Box

Select Color under Background section

Use Calculated under base color and write below expresssion

IF(WeekDay(Today()) = 'Mon', Green(),

IF(WeekDay(Today()) = 'Tue', Red(),

IF(WeekDay(Today()) = 'Wed', Blue(),

IF(WeekDay(Today()) = 'Thu', QlikTechGray(),

IF(WeekDay(Today()) = 'Fri', QlikTechBlue(),

IF(WeekDay(Today()) = 'Sat', RGB(100,100,100),

RGB(120,120,120)))))))

Anonymous
Not applicable
Author

What I can suggest (i did it this way for one application with products where each product (about 12) should always have a defined colour) is, to nhance the datamodel (in my case I added a column "Productcol". I used if statements for each product. In my Text colour properties I could use this field "Productcol").

-> You need only one expression other than several if statements for each expression where you need these colours. In your case can you enhance a table with these colours (maybe the calendar or a new table attached to calendar)?

But if you have only one expression I would suggest like Manish description. If you have more than one, you migth consider my solution. Its always a question of maintain and work to do.