Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello ,
i have a script where i have a table of customers ID and their corresponding locations and traffic
there is possibility that the customer ID may be found more than once under different locations with different traffic.
Customer ID | Location | City | Technology | Traffic |
1223 | x | Cairo | 3G | 400 |
1223 | y | Alex | 4G | 522 |
1223 | z | Cairo | 4G | 800 |
1152 | x | Cairo | 3G | 403 |
1578 | y | Alex | 4G | 121 |
my goal is to calculate the total traffic of all the customers and their total distinct count, also need to have these two counters to be calculated over multiple dimensions, as location, technology used, city, .. etc
how can i make this in the backend as a script not in the user interface ?
@EngMaher88 what is the expected output you need based on sample data?
Hello Kushal,
that's a sample of the result i need if i use the city as a dimension
Overall | Cairo | Alex | |
Total Customers | 3 | 2 | 2 |
Traffic | 2246 | 1603 | 643 |
@EngMaher88 You can use below expressions
=count(distinct Customers) // for customers
=sum(Traffic) // for traffic
Thanks Kushal for your reply
however, count(distinct Customer ID) and group by city giving me the overall value right, however the value per location is wrong
@EngMaher88 based on your sample data this what I am getting
This is matching with what you wanted
Overall | Cairo | Alex | |
Total Customers | 3 | 2 | 2 |
Traffic | 2246 | 1603 | 643 |