Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to divide totals among participants.

Hello,

I was wandering if someone can help me.

I currently have a DB, that has services made, with the total cost.

The thing is that total cost is repeated in all the register that where involved. It looks like this:

ServiceWorkerTotal Amount
1Worker 1345
1Worker 2345
1Worker 4345
2Worker 33224
2Worker 43224
2Worker 53224
2Worker 13224
3Worker 1123
3Worker 4123
4Worker 4546
4Worker 5546

I would like to have something like:

ServiceWorkerTotal AmountIndiv Ammount
1Worker 1345115 (345/3)
1Worker 2345115
1Worker 4345115
2Worker 33224806 (3224/4)
2Worker 43224806
2Worker 53224806
2Worker 13224806
3Worker 112361.5 (123/2)
3Worker 412361.5
4Worker 4546273 (546/2)
4Worker 5546273

The number inside the parenthesis wouldnt be on the data base, is just to indicate i need to count somehow how many workers are in each service, and divide the total to have a rough estimate of the contribution of each worker.

The purpose of this is to have a rough estimate of how much each worker contributes regarding the income.

thanks in advance,

KR

1 Solution

Accepted Solutions
bill_markham
Champion III
Champion III

Maybe something like the attached.

Here is the load script from it:

Data :

LOAD Service,

     Worker,

     [Total Amount]

FROM

[https://community.qlik.com/thread/193280]

(html, codepage is 1252, embedded labels, table is @1);

Left Join (Data)

Load

Count(Worker) as [Count Workers] ,

Service

resident Data

group by Service

;

View solution in original post

2 Replies
bill_markham
Champion III
Champion III

Maybe something like the attached.

Here is the load script from it:

Data :

LOAD Service,

     Worker,

     [Total Amount]

FROM

[https://community.qlik.com/thread/193280]

(html, codepage is 1252, embedded labels, table is @1);

Left Join (Data)

Load

Count(Worker) as [Count Workers] ,

Service

resident Data

group by Service

;

Not applicable
Author

Work like a charm,

thanks,