Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have dimension and multiple dates with measure corresponding to them.
Need to calculate average in straight table . But should consider only latest measure based on date. Sample data and expected output given below.
Application_Name | Date | Measure |
App1 | 1-Jul-19 | 1 |
App1 | 2-Jul-19 | 1 |
App1 | 3-Jul-19 | 1 |
App2 | 10-Oct-18 | 1 |
App2 | 1-Jan-19 | 1 |
App3 | 4-Jan-19 | 0 |
App4 | 5-Jan-19 | 4-Mar |
Expected Answer | ||
Application_Name | Date | Avg Measure |
75% | ||
App1 | 3-Jul-19 | 100% |
App2 | 1-Jan-19 | 100% |
App3 | 4-Jan-19 | 0% |
App4 | 4-Jan-19 | 100% |
Hi, this result can be done in a table with Application_Name and Date as dimension and this expression:
Avg(Aggr(If(Date=Max(TOTAL<Application_Name> Date), Measure)
, Application_Name, Date))
Maybe you need to uncheck 'supress zero values' and use a calculated dimension to keep only the rows you want:
=Aggr(If(Date=Max(TOTAL<Application_Name> Date), Date), Application_Name, Date)