Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
iParimal
Contributor
Contributor

Max date and corresponding measure for same set analysis

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_NameDateMeasure
App11-Jul-191
App12-Jul-191
App13-Jul-191
App210-Oct-181
App21-Jan-191
App34-Jan-190
App45-Jan-194-Mar
   
Expected Answer   
Application_NameDateAvg Measure
  75%
App13-Jul-19100%
App21-Jan-19100%
App34-Jan-190%
App44-Jan-19100%
Labels (1)
1 Reply
rubenmarin

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)