Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
aj_954
Contributor III
Contributor III

Display the max date of a values given an indicator

Hi,

 

I want to display the max date for a given set of values filtered by an indicator:

 

What I have so far:

 

= FirstSortedValue(DISTINCT [Dates.autoCalendar.YearMonth],-price)

however, that is giving me the max date for all the values:

 

I tried this:

= FirstSortedValue(DISTINCT [Dates.autoCalendar.YearMonth],-Max({<indicator={'QQ'}>}price))

but  I get the error " error in expression: nested aggregation not allowed" 

 

What can I do to fix it? I know I need to use AGGR() but I am getting a null value . 

1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

= FirstSortedValue(DISTINCT [Dates.autoCalendar.YearMonth],-aggr(Max({<indicator={'QQ'}>}price),[Dates.autoCalendar.YearMonth]))

View solution in original post

1 Reply
stevejoyce
Specialist II
Specialist II

= FirstSortedValue(DISTINCT [Dates.autoCalendar.YearMonth],-aggr(Max({<indicator={'QQ'}>}price),[Dates.autoCalendar.YearMonth]))