Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a basic question -- I'm trying to multiple a sum with a single value.
For instance:
-I have a table with multiple unit sales entrances per SKU
-Another table has a single value for the price of each SKU
Table A:
SKU A 4
SKU A 6
SKU A 10
Table B:
SKU A $2.00
I'm trying to do (sum(table A))*(value(table B)), as the answer would be $40.00 for SKU A in this case.
How would I value up each SKU?
Cheers,
F.
Are you trying to do this in a chart or in the script?
-Rob
Which chart are you using or you do it in script?
It's not a chart. So it's in the script, I suppose.
It's not a chart. So it's in the script, I suppose.
HI,
Try like this,
TableA:
Load * inline
[
Name1,Value
SKUA,4
SKUA,6
SKUA,10
];
join(TableA)
Load * Inline
[
Name1,Total
SKUA,2.00
];
TableB:
Load Name1,Total,Sum(Value) as TotalValue Resident TableA Group by Name1,Total;
TableC:
Load *,(TotalValue * Total) as ExpectedValue Resident TableB;
Drop tables TableA,TableB;
Instead of these 2 last loads, you can simply do:
Table_B :
Load
Name1 ,
Sum(Value) * Only(Total) as ExpectedValue
Resident TableA
Group by Name1 ;