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: 
johnso2080
Contributor
Contributor

Aggregation

Hello,

I have a table like the below....

ModelItemColourViews
A1BLUE4000
A1GREEN4000
A1BLACK4000
A2BLUE1200
A2GREEN1200
B3RED2600

What I want to do is add up the 'Views' for each model, but removing the duplication by colour.

So that the total views for item '1' = 4000, and item '2' = 1200 so the total for model 'A' would be 5200.

I've tried a couple of different Aggr() formula variations but I'm having some trouble! Any advice would be much appreciated!

Thanks

Darren

1 Solution

Accepted Solutions
Not applicable

Per Model and Item:

AGGR(SUM(DISTINCT Views), Model, Item)

Per model:

AGGR(SUM(AGGR(SUM(DISTINCT Views), Model, Item)), Model)

View solution in original post

2 Replies
Not applicable

Per Model and Item:

AGGR(SUM(DISTINCT Views), Model, Item)

Per model:

AGGR(SUM(AGGR(SUM(DISTINCT Views), Model, Item)), Model)

johnso2080
Contributor
Contributor
Author

Thank you very much!