Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

aggr( help with returning a dimension instead of expression

=max(aggr(count([t1Sales_Name and Cluster code]),[t1Sales_Name and Cluster code]))

This is my code (which doesn't work...

Table looks like so

[t1Sales_Name and Cluster code]              /      Sales

Test                                                         /      1000

Test1                                                       /      2000

I would like my aggr function to work out what [t1Sales_Name and Cluster code] has the highest sales value.

Expected output would be

Test1

Let me know if I've not been clear enough,

james.

Tags (1)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: aggr( help with returning a dimension instead of expression

If your sales field is named Sales try this:

=FirstSortedValue([t1Sales_Name and Cluster code], -aggr(sum(Sales),[t1Sales_Name and Cluster code]))


talk is cheap, supply exceeds demand
2 Replies
MVP & Luminary
MVP & Luminary

Re: aggr( help with returning a dimension instead of expression

If your sales field is named Sales try this:

=FirstSortedValue([t1Sales_Name and Cluster code], -aggr(sum(Sales),[t1Sales_Name and Cluster code]))


talk is cheap, supply exceeds demand
Not applicable

Re: aggr( help with returning a dimension instead of expression

Hey I know this is very greedy, but I have another problem. Could you perhaps write the aggr for me?

Imagine this:

[t1Sales_Name and Cluster code]    --     Count([t1Sales_Name and Cluster code])

Test                                             --          2

Test 1                                             --   1

would it be the same as your given example above?