Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
EngMaher88
Contributor II
Contributor II

Need Help on script calculation

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 IDLocationCityTechnologyTraffic
1223xCairo3G400
1223yAlex4G522
1223zCairo4G800
1152xCairo3G403
1578yAlex4G121

 

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 ? 

5 Replies
Kushal_Chawda

@EngMaher88  what is the expected output you need based on sample data?

EngMaher88
Contributor II
Contributor II
Author

Hello Kushal,

that's a sample of the result i need if i use the city as a dimension

 OverallCairoAlex
Total Customers322
Traffic22461603643
Kushal_Chawda

@EngMaher88  You can use below expressions 

=count(distinct Customers)   // for customers

=sum(Traffic)   // for traffic

EngMaher88
Contributor II
Contributor II
Author

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

Kushal_Chawda

@EngMaher88  based on your sample data this what I am getting

Kushal_Chawda_0-1631892516814.png

This is matching with what you wanted

 OverallCairoAlex
Total Customers322
Traffic22461603643