Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear
Directory;
LOAD [2nd_Distributor] as T2, Amount as Qty, BDCity as City, BDProvince as Province, BrandName, Category, Channel1 as Channel, CityTier, FYear as FY,
GroupName, InsCode, InsName, ListingBrandname, Month, PValue, SKUID, SKUName, SupDistributor as T1,
FROM INFY.csv (txt, utf8, embedded labels, delimiter is ',', msq);
Directory;
Left Join
LOAD Channel2 as Channel, T1Name as T1
FROM ChannelPrice.csv (txt, utf8, embedded labels, delimiter is ',', msq);
after use "left join", I created a new table. Now I need to add a new field in this new table.
How to write the script.
thank you so much
Jiang, did Arthur's final post get you a working solution? If so, please return to the thread and use the Accept as Solution button on the posts that helped you get things working as you needed. If you are still working upon things, leave an update with what you still need. Marking posts gives credit to those that help out in the Community as well as lets other Community members know what actually worked on each post.
Regards,
Brett
What is the column you want to add? A derived column?
<columnA> + <columnB> as <columnC>
Directory;
LOAD [2nd_Distributor] as T2, Amount as Qty, BDCity as City, BDProvince as Province, BrandName, Category, Channel1 as Channel, CityTier, FYear as FY,
GroupName, InsCode, InsName, ListingBrandname, Month, PValue, SKUID, SKUName, SupDistributor as T1,
Tier1ERPCode, Value, WWBID, Year, YM
FROM INFY.csv (txt, utf8, embedded labels, delimiter is ',', msq);
Directory;
Left Join
LOAD Channel2 as Channel, T1Name as T1, T2Name as T2, InsCode, InsName, SubBrand, T1_In_Price, T1_Out_Price, T2_Out_Price,
T2_In_Price
FROM ChannelPrice.csv (txt, utf8, embedded labels, delimiter is ',', msq);
[INFY]:
Load (PVaule < 1000) as Flag
Resident [INFY]
add this field use IF function,
tempINFY:
load *,if(PVaule < 1000,1,0) as Flag
resident INFY;
drop table INFY;
rename table tempINFY to INFY;
字段未找到 - <PVaule>
tempINFY:
load *,if(PVaule < 1000,1,0) as Flag
resident INFY
tempINFY:
load *,if(PValue < 1000,1,0) as Flag
resident INFY;
drop table INFY;
rename table tempINFY to INFY;
Jiang, did Arthur's final post get you a working solution? If so, please return to the thread and use the Accept as Solution button on the posts that helped you get things working as you needed. If you are still working upon things, leave an update with what you still need. Marking posts gives credit to those that help out in the Community as well as lets other Community members know what actually worked on each post.
Regards,
Brett