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: 
kennethand
Contributor III
Contributor III

Opposite of distinct

How do you work with distinct the opposite way?

If you have data likes this:

IDSales
110
220
3100
115
25
230

If I like to sum Sales but only for IDs which occur twice or more. How do I do that?

In this case I will get a table lieks this (ID 3 will not be summed as it only occurs once)

 

IDSum of sales
255
325
1 Solution

Accepted Solutions
woshua5550
Creator III
Creator III

you can do it by scripting or expression

if you don't want to load unique ID at all, plz follow Antoni's step

or you can do it by creating a straight table with ID as dimention and

"Sum({<ID={"=Count(ID)>1"}>}Sales)" as expression

View solution in original post

3 Replies
Ivan_Bozov
Luminary
Luminary

Hi, maybe something like:

If(Count(ID)>1, Sum(Sales), '')

Capture.PNG

vizmind.eu
antoniotiman
Master III
Master III

May be this

LOAD ID,Sales Where Count > 1;
LOAD ID,Sum(Sales) as Sales,Count(ID) as Count Inline [
ID, Sales
1, 10
2, 20
3, 100
1, 15
2, 5
2, 30
]
Group By ID
;

woshua5550
Creator III
Creator III

you can do it by scripting or expression

if you don't want to load unique ID at all, plz follow Antoni's step

or you can do it by creating a straight table with ID as dimention and

"Sum({<ID={"=Count(ID)>1"}>}Sales)" as expression