Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Adrian,
If you want the other variables still to be visible, please add a '*,'
Load *,
((Pallets - DirectPallets) * DistributionCost) + (DirectPallets * DirectDistributionCost) as TotDistribution;
Provide some sample data with your sample apps... will look into this..
Hi Adrian,
If you want to calculate it in the same table, and you don't want to re-script the formula, then a preceding load may help you.
This looks like
Table X
LOAD
c*d as Y;
LOAD
a*b as C
FROM .....
Notice the ';' after the first load statement
Hi,
Try Preceding Load for this
TableName:
LOAD
*,
Load
FROM DataSource;
Hope this helps you.
Regards,
Jagan.
Try this:
t1:
load * Inline
[
A,B,D
1,2,3 ]
;
t2:
load
A*B as c
resident t1
;
temp:
load c as C resident t2;
join
load D resident t1;
;
final:
load C*D as E resident temp;
drop table t1,t2,temp
I've tried your method but it's not quite working. I have a table which has a record for each sale and I'm trying to achieve a calculation of the distribution costs for each sale. So if my original tabel has 50 records, I should get a new table with 50 records, however I am getting 50 records for each sale. This is the script and qvw attached
'CalcTest':
Load ((Pallets - DirectPallets) * DistributionCost) + (DirectPallets * DirectDistributionCost) as TotDistribution;
Load
Year,
Week,
Product,
Units,
Pallets,
Pallets * DirectPallet% as DirectPallets,
DistributionCost,
DirectDistributionCost
resident 'Sheet1';
drop field DistributionCost,
DirectDistributionCost,
DirectPallet%;
Hi Adrian,
If you want the other variables still to be visible, please add a '*,'
Load *,
((Pallets - DirectPallets) * DistributionCost) + (DirectPallets * DirectDistributionCost) as TotDistribution;
Hi,
U can achieve these through Preceding Load.
Regards,
Mukesh Chaudhari