Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

inowinowski
New Contributor

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
Valued Contributor III

Re: Aggr

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.

5 Replies
MVP
MVP

Re: Aggr

May be like:

Straight table:

Dimension: [Buyer Name]

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

inowinowski
New Contributor

Re: Aggr

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

MVP
MVP

Re: Aggr

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
Valued Contributor III

Re: Aggr

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.

inowinowski
New Contributor

Re: Aggr

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

Community Browser