Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How can I insert a column with values replacing one letter values in column 'PurcharseOrderTypeLine' :
Ex : P = Purchase
F = Force
S = Sale, ect....
Thx in advance
Hi,
May be try this..
Load YourFields,
if(PurcharseOrderTypeLine='P','Purchase',
if(PurcharseOrderTypeLine='F','Force',
if(PurcharseOrderTypeLine='S',Sale))) as PurcharseOrderTypeLine
Resident [YourtableName];
Hi,
May be try this..
Load YourFields,
if(PurcharseOrderTypeLine='P','Purchase',
if(PurcharseOrderTypeLine='F','Force',
if(PurcharseOrderTypeLine='S',Sale))) as PurcharseOrderTypeLine
Resident [YourtableName];
You can use a Mapping Load as it seems that you may have multiple PurchaseOrderTypeLine and doing it with if can be a hassle
MappingTable:
MAPPING
LOAD PurcharseOrderTypeLine,
Description
FROM Excel;
or you can do a Inline Load also
Fact:
LOAD allFields,
ApplyMap('MappingTable', PurcharseOrderTypeLine) as PurcharseOrderTypeLine1
FROM Source;
Hi,
Try like this
Load *,
if(PurcharseOrderTypeLine='P','Purchase',
if(PurcharseOrderTypeLine='F','Force',
if(PurcharseOrderTypeLine='S', 'Sale', 'N/A'))) as PurchaseOrderType
From DataSource;
OR the better way
Load *,
Pick(Match(PurcharseOrderTypeLine, 'P', 'F','S', '*'), 'Purchase','Force', 'Sale', 'N/A') AS PurchaseOrderType
From DataSource;
Efficient way:
LOAD
*
FROM DataSource;
Now create an Excel with below details
PurcharseOrderTypeLine, PurchaseOrderType
P, Purchase
F, Force
S, Sale
Now load this Excel file, this tables joins with the existing table based on PurcharseOrderTypeLine column, if in future there is any new value just add a new record in the Excel file.
Hope this helps you.
Regards,
Jagan.
Hi ssaintlouis
Can you attach the sample file along with dummy data. It will help the folks to give quick solution. THanks.
Merci