Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to add a calculated column to a resident table.
I am using this way...
[Table_2]
Load *,
Amount * quantity as totalAmount
Resident Table_1;
Drop table Table_1;
It works but when i need to ad several columns which depends on an other calculated columns then i need to repeat this process...like
If i want to add percentage of totalAmount then i need to repeat this process like
[Table_3]
Load * ,
totalAmount * .01 as percentage
Resident Table_2;
Drop Table Table_2;
Can I do both operations in one Load statement?
Regards,
Saurabh
Hi Saurabh,
You can try this method:
1. Method1 (Preferable)
[Table_2]
Load *, totalAmount*0.01 AS percentage;
Load
*,
Amount * quantity AS totalAmount,
Resident Table_1;
Drop table Table_1;
===============================
2. Method2
[Table_2]
Load
*,
Amount * quantity AS totalAmount,
Amount * quantity * 0.01 AS percentage
Resident Table_1;
Drop table Table_1;
Regards,
Sokkorn
Hi Saurabh,
You can try this method:
1. Method1 (Preferable)
[Table_2]
Load *, totalAmount*0.01 AS percentage;
Load
*,
Amount * quantity AS totalAmount,
Resident Table_1;
Drop table Table_1;
===============================
2. Method2
[Table_2]
Load
*,
Amount * quantity AS totalAmount,
Amount * quantity * 0.01 AS percentage
Resident Table_1;
Drop table Table_1;
Regards,
Sokkorn