Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear experts,
I'm getting wrong results on a table that I feel is caused by something related to scope but I can't figure it out and been I've searching for hours. I feel like I'm missing something very simple.
Here's the basic data structure, there are "Actual Calls" and "Planned Calls" for each Customer for each Employee:
I'm analyzing the data by employee in a table, and I've created a new measure "Called Customers", which is basically counting the number of customers with "Actuals Calls" > 0:
count({<Customer = {"=sum([Actual Calls])>0"}>}distinct Customer)
Here's the issue, if I add this measure to the table, notice that Emp1 has 8 "Called Customers", when in fact it has only 7 customer with Actuals Calls > 0.
I think the problem comes because Cust08 is duplicated, it appears both for Emp1 and Emp2. For Emp1 it has 0 Actuals Calls but for Emp2 it has Actual Calls>0.
This is what I don't understand. For Emp1 Cust08 has 0 Actual Calls so it shouldn't be appearing in the measure. It's like the measure is looking at all customers first, and then applying the dimension. I would expect that because Employee is a dimension in the table, for row Emp1 it would only look at the rows for Employee1 in the data, and then calculate the measure, but somehow the Emp2 Cust08 is being included.
However, if I filter the Employee to only Emp1, then it does show the correct answer of 7:
What am I missing here? I want to solve this but most importantly to really understand the logic of why this is happening so any resources you could point me to to further understand this would be much appreciated.
I've also attached the sample file.
Thank you in advance!
You can also use this expression and it will give you the same result:
count({<ActualCalls = {"=[ActualCalls]>0"}>} Customer)
Hello,
Can you please replace your set analysis:
From: count({<Customer = {"=sum([Actual Calls])>0"}>}distinct Customer)
To: count({<ActualCalls = {"=[ActualCalls]>0"}>} Employee)
Hope this helps...
You can also use this expression and it will give you the same result:
count({<ActualCalls = {"=[ActualCalls]>0"}>} Customer)
Thank you Raja! That solved it.
It makes much more sense to use the set analysis on the actual field I'm trying to put the condition on. I guess before I was telling the engine to find all the customers with Actual Calls > 0 first, and then assign those to each Employee (where the duplication was causing the issue because Cust08 is also mapped to Emp1), instead of starting with selecting only the records with Actuals Calls > 0 first, and then assign the remaining Customers to each Employee.
Thank you for the quick reply!
Best
You are welcome... And your understanding is correct..
Have a nice day...