Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

aaronnayan
Contributor 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

Re: Create new field using if statement

How about this?

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

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)
4 Replies
briancopple
Contributor II

Re: Create new field using if statement

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

Re: Create new field using if statement

How about this?

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

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
Contributor III

Re: Create new field using if statement

Hi Thanks for your response.

Where do i use the field [location]?

Highlighted
vishsaggi
Esteemed Contributor III

Re: Create new field using if statement

May be try this?

LOAD *,

           Location,

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

FROM tablename;