Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Using a Set expression with AGGR function

Hi,

I'm trying to generate metric to determine how many times a set of object match/belong to a set of categories, for example:

prodID          category/ies                                                result by product

A                    11493655                                                  1

B                    18340461, 26434083                                2

C                    31152327                                                  1

D                    26434083,18361991, 31152327               3

Total result for the above presented data would be  7

The expression I wrote is:

sum ( aggr (count( {$< category ={11493655, 18340461, 26434083,18361991, 31152327}>} distinct prodID), category)   )

Somehow it is not working at all, if somebody could give it a look and find out the problem I can't I would be thankful!!

Thanks in advence,

Javier

1 Solution

Accepted Solutions
sunny_talwar

May be this

Sum(Aggr(Count({$<category = {'11493655', '18340461', '26434083', '18361991', '31152327'}>} DISTINCT prodID), category, prodID))

View solution in original post

2 Replies
sunny_talwar

May be this

Sum(Aggr(Count({$<category = {'11493655', '18340461', '26434083', '18361991', '31152327'}>} DISTINCT prodID), category, prodID))

Anonymous
Not applicable
Author

Thank you very much Sunny!!