Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How do you work with distinct the opposite way?
If you have data likes this:
ID | Sales |
1 | 10 |
2 | 20 |
3 | 100 |
1 | 15 |
2 | 5 |
2 | 30 |
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)
ID | Sum of sales |
2 | 55 |
3 | 25 |
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
Hi, maybe something like:
If(Count(ID)>1, Sum(Sales), '')
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 ;
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