Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all.
I have a filter pane with the values,say, pink, yellow, blue
and a kpi that calculates count(distinct ItemID)
If i select pink the count is 56
If i select yellow the count is 40
but if i select pink and then yellow (so if i make two selections and let's suppose an item can be two colours at once, that's because i can't share my data) the result is 94.
I thought the calculation was just addition, ignoring if there are already pink items in the yellow that have already been calculated when selected "pink". Is it something like A+B-(A intersection B) ?
So you want to count ItemIds having both "pink" & "yellow"?
Hi @Kushal_Chawda ,I want to know what's the calculation behind two selections in a filter pane.
I thought it did, all of them who are pink AND all of them who are yellow, not accounting for intersections.
I was expecting 96.
Default is "OR" so it will look for all ID's where there is either "pink" or "yellow"
If you want yellow + pink, you have to use aggr function.
For example: Sum(Aggr(count(distinct ItemID), colour field))
I see. so what you are saying is that if there's any items that could fall in both categories then they are ignored and not calculated? And that's why it's 94 and not 96?
Using count distinct, you count all distinct items (no matter if they exist only yellow, pink or both).
Example
A - yellow
A - pink
B - yellow
C - pink
You have A, A, B, C so a count distinct will show 3.
But if you select yellow or pink, you'll have 2.
It will count that as well but as you are using distinct keyword it will count single instance of ID