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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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

Labels (1)
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
tresB
Champion III
Champion III

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

tresB
Champion III
Champion III

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