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: 
Not applicable

Advanced Aggr Function

I am trying to solve for the code below

sum({$<CalendarYear = {$(#=max(CalendarYear))}>} [Spend])) /

sum(aggr(sum({$<CalendarYear = {$(#=max(CalendarYear)-1)}>} [Spend])) /

sum({$<CalendarYear = {$(#=max(CalendarYear)-1)},CalendarQuarter=,CalendarMonth=>} Qty)) *

sum({$<CalendarYear = {$(#=max(CalendarYear))}>} if(len(Subcategory)>0,Qty)), Material))

On top of this I want to add the below condition for spend in the numerator (highlighted in red):

Calculate spend in current year only when Material exists in "max(CalendarYear)-1" so I wanted to use an aggr function in Numerator?

Thanks,

Prakash

0 Replies