Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
Service | Worker | Total Amount |
---|---|---|
1 | Worker 1 | 345 |
1 | Worker 2 | 345 |
1 | Worker 4 | 345 |
2 | Worker 3 | 3224 |
2 | Worker 4 | 3224 |
2 | Worker 5 | 3224 |
2 | Worker 1 | 3224 |
3 | Worker 1 | 123 |
3 | Worker 4 | 123 |
4 | Worker 4 | 546 |
4 | Worker 5 | 546 |
I would like to have something like:
Service | Worker | Total Amount | Indiv Ammount |
---|---|---|---|
1 | Worker 1 | 345 | 115 (345/3) |
1 | Worker 2 | 345 | 115 |
1 | Worker 4 | 345 | 115 |
2 | Worker 3 | 3224 | 806 (3224/4) |
2 | Worker 4 | 3224 | 806 |
2 | Worker 5 | 3224 | 806 |
2 | Worker 1 | 3224 | 806 |
3 | Worker 1 | 123 | 61.5 (123/2) |
3 | Worker 4 | 123 | 61.5 |
4 | Worker 4 | 546 | 273 (546/2) |
4 | Worker 5 | 546 | 273 |
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
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
;
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
;
Work like a charm,
thanks,