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: 
sifatnabil
Specialist
Specialist

Set Analysis: aggregation issue

Hi, I have a table like this:

uniquetradeidType
11V
12V
11V
13V
13V
15V
15V
15V
16V
17E
17V

I want to translate the following to set analysis so that I can represent this in both text boxes and graphically:


E = distinct count of uniquetradeid which has no V in another row with the same uniquetradeid.

V = distinct count of uniquetradeid which has no E in another row with the same uniquetradeid.

H = distinct count of uniquetradeid which includes both E AND V in its rows.


So in the example, the results should be

E=0,

V= 5,

H=1

How can I get this with set analysis both in text box and graphically? Thanks.

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

=Count(DISTINCT {<uniquetradeid=P({<Type={'E'}>})>-<uniquetradeid=P({<Type={'V'}>})>} uniquetradeid)

=Count(DISTINCT {<uniquetradeid=P({<Type={'V'}>})>-<uniquetradeid=P({<Type={'E'}>})>} uniquetradeid)

=Count(DISTINCT {<uniquetradeid=P({<Type={'E'}>})>*<uniquetradeid=P({<Type={'V'}>})>} uniquetradeid)

View solution in original post

2 Replies
anbu1984
Master III
Master III

=Count(DISTINCT {<uniquetradeid=P({<Type={'E'}>})>-<uniquetradeid=P({<Type={'V'}>})>} uniquetradeid)

=Count(DISTINCT {<uniquetradeid=P({<Type={'V'}>})>-<uniquetradeid=P({<Type={'E'}>})>} uniquetradeid)

=Count(DISTINCT {<uniquetradeid=P({<Type={'E'}>})>*<uniquetradeid=P({<Type={'V'}>})>} uniquetradeid)

MK_QSL
MVP
MVP

=COUNT({<Type = {'E'}, uniquetradeid = E({1<Type = {'V'}>})>}Distinct uniquetradeid)

=COUNT({<Type = {'V'}, uniquetradeid = E({1<Type = {'E'}>})>}Distinct uniquetradeid)

=COUNT({<Type = {'E'}, uniquetradeid = P({1<Type = {'V'}>})>}Distinct uniquetradeid)