Solved

conditional layout check on a date

  • 15 December 2022
  • 1 reply
  • 49 views

Userlevel 3
Badge +5

Hi,

I'm trying to apply a conditional layout on a column containing a “best before” date.
I hope to mark it red when the best_before < CAST(GETDATE() AS DATE) but CAST(GETDATE() AS DATE) obviously isn’t a constant…
When creating prefilters I can use a query but that doesn't seem to be an option for conditional layouts?

For now the only solution I can think of is adding an additional column (expression) that contains the beforementioned CAST(GETDATE() AS DATE) and use that column.
It works but I'm not 100% pleased with this workaround 🤔

icon

Best answer by Mark Jongeling 15 December 2022, 11:35

View original

This topic has been closed for comments

1 reply

Userlevel 7
Badge +23

Hi @Alban_T,

Indeed, the only current way to do this properly is by creating a (hidden) expression column that either say 1 or 0 based on the outcome of your query. The Conditional layout will then respond based on that number.

We do have an idea open about allowing a query as Conditional layout condition: