Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like some help with IF syntax.
I am trying to add an additonal column called 'T2' in my table through the load script, this is what i have so far:
IF
(
Tier2_Org_Area = 'Europe & Digital' OR
Tier2_Org_Area = 'USA', 'RED') as T2,
IF
(
Tier2_Org_Area = 'Africa', 'Blue')
as T2
However when i reload the data i get an error message saying column names cannot be the same, I was hoping the second IF statement would just be concatenated to the first T2 column?
Any ideas?
Thanks
Sunil
Hi Sunil,
I'm not sure with this help you or not
IF(Tier2_Org_Area = 'Europe & Digital' OR Tier2_Org_Area = 'USA', 'RED',
IF(Tier2_Org_Area = 'Africa', 'Blue','Other')) as T2,
Let me know.
Regards,
Sokkorn
Hi,
You have to write some thing like
IF(
Tier2_Org_Area = 'Europe & Digital' OR
Tier2_Org_Area = 'USA', 'RED',
IF(
Tier2_Org_Area = 'Africa', 'Blue') )
as T2
Rgds
Anand
Hi Sunil,
I'm not sure with this help you or not
IF(Tier2_Org_Area = 'Europe & Digital' OR Tier2_Org_Area = 'USA', 'RED',
IF(Tier2_Org_Area = 'Africa', 'Blue','Other')) as T2,
Let me know.
Regards,
Sokkorn
Hi,
You have to write some thing like see in example
Data:
Load * inline
[
Tier2_Org_Area
Europe & Digital
USA
Africa
];
Load
*,
IF(
Tier2_Org_Area = 'Europe & Digital' OR
Tier2_Org_Area = 'USA', 'RED',
IF(
Tier2_Org_Area = 'Africa', 'Blue'))
as T2
Resident Data;
See the example file
Rgds
Anand