Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm calculating the distance of days between two date fields in a dimension.
[Date1] - [Date2]
Now I also want to check if the result agrees with the smallest result (MIN).
if([Date1]-[Date2]=Aggr(Min([Date1]-[Date2],[Part]), 'Flag', null())
Unfortunately I get no result here (null()). I can't compare the two values.
But why? What am I doing wrong?
I would create a new field in the script:
Date1 - Date2 as DateDiff,
and then you can use this as dimension, or inside a Min()
HIC
Thanks for your answer. Unfortunately I can't use it in the script because a date field is a variable. The date can therefore be changed at any time.
Then you are right to use an Aggr(). Try
Dimension to calculate diff:
Aggr([Date1]-[Date2],[Date1],[Date2])
Flag to test for Min:
Aggr(If([Date1]-[Date2]=Min(total [Date1]-[Date2]),'Min','Other'),[Date1],[Date2])