Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to calculate the max date to use as a dimension. The other discussion I have seen around this only address this calculation as a measure (as far as I can tell)
Date | Date(Max(Date),'YYYY-MM-DD') |
---|---|
2018-03-01 | 2018-03-03 |
2018-03-02 | 2018-03-03 |
2018-03-03 | 2018-03-03 |
If I use this cacluation as a measure in a table, I get the expected result. But if I calculate it as a dimension, it gives me an invalid dimension error. I need to calculate it as a dimension to use on an axis of a bar chart.
Your ideas helped and I got it to work by adding TOTAL to Max and wrapping it with AGGR.
Date(Aggr(Max(TOTAL Date),Date),'YYYY-MM-DD')
May be try this -
if(Date=Max(Date),Date)
or
Aggr(if(Date=Max(Date),Date),Date)
or
Aggr(Only({<Date={$(=Max(Date)}>}Date)
Thank you for the ideas... I was hopefull that adding the if statement would work, but unfortunately not.
if(Date=Max(Date),Date) returned invalid dimension error
Aggr(if(Date=Max(Date),Date),Date) returned the Date and not max date
Aggr(Only({<Date={$(=Max(Date)}>}Date) returned invalid dimension error
Your ideas helped and I got it to work by adding TOTAL to Max and wrapping it with AGGR.
Date(Aggr(Max(TOTAL Date),Date),'YYYY-MM-DD')
=aggr(max(all Date),Date)