The first thing that may come to our mind is to write a good conditional like
Date=Max(Date) ? Or use Window_Max(Max(Date))? Then datediff()?
I don't know how those will work. But I know something that will work and it's quite simple. No need to fight with aggregate or window functions.
To select the value associated with min(Date), we just need to write this
- if first() = 0 then [measure] end
For the value associated with max(Date), the formula is
- if last() = 0 then [measure] end
- first() = -1
- last() = 5
From the table, you can now figure out the formula for any date in between, as long as you are given the offset from the first or last date.
Click the above image to download the workbook.
No comments:
Post a Comment