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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
taylor_jesse
Creator
Creator

Qlikview Date Color Change setup

Hi,

I am trying to set a back ground color for a date to turn yellow if its within two months but once the due date is past then I want it to turn white. I used the expression below but it stays yellow even if the date is past due.

For instance already past days are still yellow. I inserted the expression in the background color definition.

if([Contract Renewal Date]<=today()+ 60, Yellow(), White())

Thank you

1 Solution

Accepted Solutions
agomes1971
Specialist II
Specialist II

Hi,

hope this it:

=if([Contract Renewal Date] >= Today() and [Contract Renewal Date] <= addmonths(Today(),6), LightRed(), White())

View solution in original post

25 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Make sure the field [Contract Renewal Date] actually contains date values and not just strings that only look like dates. You can use the date# function in the script to turn string values into date values. Feel free to post a small example demonstrating the problem if you get stuck.


talk is cheap, supply exceeds demand
taylor_jesse
Creator
Creator
Author

Hi,

I added date() to the contract renewal date field but still getting the same result

I did

Date([Contract Renewal Date]) as [Contract Renewal Date].

Do you think maybe something needs to be aded to the expression so that when the date passes the yellow background color turns off?

Thank you

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The date() function only applies a format to a value. The date#() function can turn text values into date values.


talk is cheap, supply exceeds demand
taylor_jesse
Creator
Creator
Author

Good morning,

Changing adding date#() removed all the values in the cell. Do you think an expression can be written to make this change?

Thank you

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Have you read the online help about the date#() function?

If not, have a look at https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/Interpretation...

Of course, it could be another problem altogether. Can you post a small example qlikview document that shows the problem?


talk is cheap, supply exceeds demand
taylor_jesse
Creator
Creator
Author

Please see the image below. The first date with yellow is now a past date and the background color still remains.

agomes1971
Specialist II
Specialist II

Hi,


=if(rangesum(before( YourExpression , 0, columno() )) = 0, yellow() )


HTH


André Gomes

taylor_jesse
Creator
Creator
Author

Hi,

Do you mean column() or columno?

Thank you