Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
aaronnayan
Creator III
Creator III

Create new field using if statement

Hi guys,

I have a field which has string values. I want to create a field flag if any of the values contain the word 'enter'.

[Location]

London,

singapore enter

china enter

enter Japan

India

Germany

This new field should seperate all values that do/dont have enter in them

Thanks,

Aaron

1 Solution

Accepted Solutions
Anil_Babu_Samineni

How about this?

If(Index(Location,'enter'), Location) as Enter_Location

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

4 Replies
Anonymous
Not applicable

Hi Aaron

In your load script try if(match('enter ',' enter'),'Y','N') as Flag this way you will capture locations that have space before the word enter or after. If there is no space after the word just amend to 'enter'

Kindest regards

Brian

Anil_Babu_Samineni

How about this?

If(Index(Location,'enter'), Location) as Enter_Location

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
aaronnayan
Creator III
Creator III
Author

Hi Thanks for your response.

Where do i use the field [location]?

vishsaggi
Champion III
Champion III

May be try this?

LOAD *,

           Location,

           IF(Wildmatch(Location, '*enter*') >0, Location) AS EnterLocation

FROM tablename;