Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Sunil_Kenth
Former Employee
Former Employee

Help with IF statement and adding additional columns in script

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

1 Solution

Accepted Solutions
Sokkorn
Master
Master

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

View solution in original post

3 Replies
its_anandrjs

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

Sokkorn
Master
Master

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

its_anandrjs

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