Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a main table with fields (from SQL):
ID,
YearMonth,
Date,
Sell_price
Cost_price
now i load a table a (from excel) with fields
YearMonth,
Cost_Price_Per_Month
How do I bring Cost_Price_Per_Month value (from the excel table) to the Cost_Price on first table to make a calculation on it.
In the script level.
Thank You.
table_1:
load
ID,
YearMonth,
Date,
Sell_price,
Cost_price
from .....;
inner join (table_1)
load YearMonth, Cost_Price_Per_Month
from
./excel....;
table_2:
load ID, YearMonth, Date, Sell_Price, if(isnull(Cost_Price), Cost_Price_Per_Month, Cost_Price) as new_cost_price
resident table_1;
drop column Cost_Price, Cost_Price_Per_Month from table_2;
drop table_1;