- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Basing table row color on year
Hello, I hope someone can help me out here.
I have a spreadsheet with a column called Date Highlighted. The format is m/dd/yyyy. I have this expression:
=If(Year([Date Highlighted]) = 2021, 'green()', white())
My thinking is that if the year is 2021, then the row should be green, otherwise it's white. However, all rows are white. Can someone tell me what is wrong with my expression?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you passed green() in single quotes '', remove quotes and try
Or
If(Date([Date Highlighted],'YYYY') = 2021, green(), white())
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, neither solution worked. It's not a big deal though. Just trying to replicate my spreadsheet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If this formula is being passed to the field expression, it will be white. However, it should work as expected if you use it as a formula in the background color expression.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, that is where I am passing the expression.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was searching for articles where the entire row’s background color could be changed but could not find any. I posted the question here: https://community.qlik.com/t5/App-Development/Changing-the-row-color-in-a-table-in-Qlik-Sense/m-p/18... if you know, please let me know.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I subscribed to the channel. Hopefully and answer appears.