Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
dirk_konings
Creator III
Creator III

Calculate client share for a region

Hi i have following data :

ClientRegionWorkedHours
A110
A110
A210
A210
A110
B310
B310
B310
C110
C110
C210
C210


When loaded into QV, i want to get this result :

RegionWorkedHoursDistinct ClientsCorrect # Clients
15021,1
24020,9
33011
Total12053


How do i calculate the column 'Correct # Clients'?

Client A has a share of worked hours in region 1 and 2.

0,6 in Region 1 and 0,4 in Region 2

And the 3 in the total is the correct number of distincted clients over all regions.

Thanks

Dirk konings

1 Solution

Accepted Solutions
Not applicable

Hi Dirk,

You could create a pivot table with Region as dimension and the following as expressions

Worked Hours:


Sum (WorkedHours)


Dinstinct Clients:


Sum(aggr(TextCount (DISTINCT Client),Region))


Correct # Clients:


Sum(aggr(sum(WorkedHours)/sum(Total <Client> WorkedHours),Region,Client))


You should enable Partial sums for Region in your pivot table.

I am attaching an example based on your data.

Do let me know if this is what you are looking for.

Nimish

View solution in original post

1 Reply
Not applicable

Hi Dirk,

You could create a pivot table with Region as dimension and the following as expressions

Worked Hours:


Sum (WorkedHours)


Dinstinct Clients:


Sum(aggr(TextCount (DISTINCT Client),Region))


Correct # Clients:


Sum(aggr(sum(WorkedHours)/sum(Total <Client> WorkedHours),Region,Client))


You should enable Partial sums for Region in your pivot table.

I am attaching an example based on your data.

Do let me know if this is what you are looking for.

Nimish