Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Change

Hi Community ,

In my file i have field called Name in which the data is like >=HIde SN or Rs

Now where ever there is SN it should  it shoud be replaced by Sense and RS should be Ross

the out put should be like this

Input               Output

<=2-SN-HIDE         Sense

8-SN                Sense

>=64-RS             Ross

=det-23<            =det-23<

wet<tt/40           wet<tt/40

Tahnks in advance

1 Solution

Accepted Solutions
sunny_talwar

May be the requirement is this:

If(WildMatch(Name, '*SN*', 'Sense', If(WildMatch(Name, '*RS*', 'Ross', Name)) as NewName

View solution in original post

7 Replies
Anonymous
Not applicable

try like this at script?

If(Fieldname like '*SN*', Replace(FieldName, 'SN','Sense'),

If(Fieldname like '*RS*', Replace(FieldName, 'RS','Ross')) as NewField

Anonymous
Not applicable

Hi John,

Please try the following in the script:

                    if(Name = {'*SN*'},  'Sense',

                         if(Name = {*RS*}, 'Ross')

                    ) as Name

Anonymous
Not applicable

check the attachment?

tresesco
MVP
MVP

Try like:

Clause:

LOAD

     If(Index(Name, 'SN'), 'Sense', If(Index(Name, 'RS'), 'Ross', Name)) as Name,

     Location

FROM

(ooxml, embedded labels, table is Sheet1);

sunny_talwar

May be the requirement is this:

If(WildMatch(Name, '*SN*', 'Sense', If(WildMatch(Name, '*RS*', 'Ross', Name)) as NewName

Anonymous
Not applicable

This will not work as this is not the proper format for comparing wildchar(*)....

Like, Wildmatch(),match() etc are used for those such comparison

tamilarasu
Champion
Champion

You can also use,

Pick(WildMatch(Upper(Trim(Name)),'*SN*','*RS*')+1,Name,'Sense','Ross') as NewName