Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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;