Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to set a Background Color expression by date. I want it to show green if within a year of the Aggr(max(LAST_INSPECTION_DATE),TRAILER) or Red if greater than a year of the Aggr(max(LAST_INSPECTION_DATE),TRAILER).
I have
IF(Year(Aggr(max(LAST_INSPECTION_DATE),TRAILER)) > AddYears(Aggr(max(LAST_INSPECTION_DATE),TRAILER),1), LightRed(),Green())
And I get this all green
It returned
@QlikSenseUser2 your dates contains future dates till 2051? In that case what is your reference date to colour the dates?
But when I try
Aggr(max(LAST_INSPECTION_DATE),TRAILER) it doesn't
Do you think this is the issue? That is the expression for that measure (Last Inspection Date)
No only until 2021.
@QlikSenseUser2 see your result in previous reply. It is showing 2051 year. Looks like your data is not correct. Also, you cannot use just aggr in KPI object. You also need some aggregation on top of that something like.. sum(aggr(max(Sales),Product))
Sorry, The max date is 5/20/2051, but I'm just trying to show 1 year from the current LAST_INSPECTION_DATE.
@QlikSenseUser2 try below. Make sure that you are using below same expression on correct column. If this still did not work share the sample qvf file
=if(LAST_INSPECTION_DATE > addyears(Today(),-1) and LAST_INSPECTION_DATE <= Today(), Green(),Red())
Thanks that worked!!!