Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to count distinct users avoiding some dimensions?

Hello everyone and thank you for your time.

I am trying to calculate the ratio of cache failures and unique users every day (dimension) and also per Country (dimension).

Input data is something like that:

  

CountryDateErrorTypeuser
Argentina01/10/2016Cache1
Spain01/10/2016Network2
Argentina01/10/2016Comm1
Spain01/10/20163
Spain01/10/2016Comm2
Spain02/10/20163
Argentina02/10/2016Cache1
Argentina02/10/2016Cache1
Spain02/10/20162
Spain02/10/2016Network2
Argentina02/10/20161
Argentina03/10/2016Network1
Spain03/10/20162
Spain03/10/20163
Spain03/10/2016Cache3
Argentina03/10/2016Network1
Spain03/10/20162
Spain03/10/2016Comm3

As said, I'd like to calculate the ratio between Cache failures (there are more failure types) and total distinct users everyday (with and without failure), and i am only able to calculate unique users with Cache failures, which is not the correct calculation.

I have calculate it on Excel to exactly know what I need (and what I mean). This first table is the number of Cache failures per Country and per Date:

Cache Failures
Argentina
01/10/20161
02/10/20162
03/10/20160
Spain
01/10/20160
02/10/20160
03/10/20161

Next, I have counted distinct users per Country and Date:

Distinct user count
Argentina
01/10/20161
02/10/20161
03/10/20161
Spain
01/10/20162
02/10/20162
03/10/20162

Finally, by dividing the correct data from each table, we get the ratio between the daily failures in each country and the daily distinct users per country.

 

Cache failuresUnique usersCache failure vs distinct users
Argentina
01/10/201611100%
02/10/201621200%
03/10/2016010%
Spain
01/10/2016020%
02/10/2016020%
03/10/20161250%

Is there a way to perform it in a graph or a pivot table? I was able to count the failures, but the percentage was not ok due to the bad calculation of users (because it was calculating unique users per Country, day and Error Type, and not only per Country and day). I think this is the main problem, but I am not totallly sure about it. For example, regarding Spain, the 03/10/2016 it was 1 cache failure (it occured to user 3). In QV I am obtaining a 100% cacher failure percentage (cause there was 1 cache failure and it affected just 1 user), but that's not what I am looking for, because in Spain the 03/10/2016 there were 2 distinct users, and that's why (in Excel) we should get 50% of cache failure that day in Spain.

Hope I have explained it in a correct way and you can help me, and if you have any questions regarding the explanation of the issue, feel free to ask me.

Again, thank you very much for your help!

Jose

1 Solution

Accepted Solutions
sunny_talwar

This?

Capture.PNG

Expressions

=Count({<ErrorType = {'Cache'}>} user)

=Count(DISTINCT TOTAL <Country> user)

=Column(1)/Column(2)

View solution in original post

3 Replies
sunny_talwar

This?

Capture.PNG

Expressions

=Count({<ErrorType = {'Cache'}>} user)

=Count(DISTINCT TOTAL <Country> user)

=Column(1)/Column(2)

Not applicable
Author

Hello Sunny T, thank you very much for your response!

Ot was almost exactly what I was looking for, but thanks to you I did it!

Basically, in the second expression, it was needed to add Date dimension:

=Count(DISTINCT TOTAL <Country,Date> user)

and that's all.


Thank you again!


sunny_talwar

As long as your got what you were looking for, I am all good

Best,

Sunny