Hello,
I have a repeating cost that is only being paid out once per order and I need to apply it to three different types of products going into that one order.
Input | ||
Order | Cost | Type |
123456 | 7.95 | A |
123457 | 7.95 | A |
123457 | 7.95 | B |
123458 | 7.95 | C |
123459 | 7.95 | A |
123459 | 7.95 | B |
123459 | 7.95 | C |
Output | |||
A | B | C | |
123456 | 7.95 | 0 | 0 |
123457 | 3.975 | 3.975 | 0 |
123458 | 0 | 0 | 7.95 |
123459 | 2.65 | 2.65 | 2.65 |
Any ideas how I could do that?
@afinzel2
We can first count how many "Type" consisting in one order then do an average, then join back with the original input.
After a CrossTab, we are there.