Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

IF statement in the script

Hi guys,

How to properly wright the script which will create new column and add data as followed: check 2 columns ([name A] and [name B] - ALWAYS only one of them might have data and NEVER both, sometimes both columns might be empty) and add it to created new column

I am sure it is simple IF statement, but I am not sure how to check if field is empy.

Thank you,

Andrzej

1 Solution

Accepted Solutions
sunny_talwar

Or the alternative if the above doesn't work would be:

If(IsNull([Name A]), [Name B], [Name A]) as NewColumn

Best,

S

View solution in original post

5 Replies
sunny_talwar

you can do something like this:

LOAD yourOtherFields,

          Alt([Name A], [Name B]) as NewColumn

Resident/From XYZ;

This would work in your situation where only one or the other will have a value.

HTH

Best,

S

sunny_talwar

Or the alternative if the above doesn't work would be:

If(IsNull([Name A]), [Name B], [Name A]) as NewColumn

Best,

S

Not applicable
Author

The first solution didn't work for me...

Not applicable
Author

I changed the second solution a little but basicaly "IsNull" this is what i was looking for.

if(not isNull(NameA), NameA, if(not isnull(NameB), NameB)) as [New Name],


sunny_talwar

I guess the second one worked then, since you marked it as a correct answer.

Best,

S