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

Aggr

Hello,

I want to sum([Units YTD]) for the max([Period_Number]) and aggr by Buyer Name. How exactly can I do this?

Thanks,

Isabel

1 Solution

Accepted Solutions
simondachstr
Specialist III
Specialist III

Based on tresesco's post try the following:

=aggr([Buyer Name], sum({<[Period_Number])={"$(=Max([Period Number]))"}>} [Units YTD]))


Note, however, if you have multiple Buyer Names you might need to aggregate your result.

View solution in original post

5 Replies
tresesco
MVP
MVP

May be like:

Straight table:

Dimension: [Buyer Name]

Expression: =Sum({<[Period Number]={"$(=Max([Period Number]))"}>} [Units YTD])

Anonymous
Not applicable
Author

Hello,

Thank you, that works as a straight table however I should have mentioned that I am trying to do it as a text object.

Thanks,

Isabel

tresesco
MVP
MVP

Are you expecting a single value as output? If so, then what do you really mean by '... and aggr by Buyer Name' ? Could you explain a bit more?

simondachstr
Specialist III
Specialist III

Based on tresesco's post try the following:

=aggr([Buyer Name], sum({<[Period_Number])={"$(=Max([Period Number]))"}>} [Units YTD]))


Note, however, if you have multiple Buyer Names you might need to aggregate your result.

Anonymous
Not applicable
Author

Hello,

Yes, I do have multiple buyer names and would like the result based on the Buyer Name selected in a list box.

Thanks,

Isabel