Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

remove part of a string using wildcard

i have rows that contains this for example:

item 1 (test 100000)

item 2 (test 200000)

item 3#

item 4

i want to create a mapping/table that contains this:

(*) , ''

#  , ''

etc

i know the method of robert using mappingwithwildcards. But for the (test 100000) this is not suffient.

i want to have this in the end:

item 1

item 2

item 3

item 4

how can make this work?

9 Replies
brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi, Amien,

what about string functions:

Left (Field,6) As Field

Greetings from Munich

Martina

EVACO GmbH

amien
Specialist
Specialist
Author

Thanks for your reply

LEFT gives me a problem with item3 and 4

Plus in the end i have a long list with garbage to strip

amien
Specialist
Specialist
Author

wildmatch( M, 'ja*','fe?','mar')

this would work, if i put a replace function before it.. BUT

it's not very maintemance friendly.

it it possible to use a table with wildmatch?

brenner_martina
Partner - Specialist II
Partner - Specialist II

Why do you get problems with item 3 and item 4 by using the left-function?

amien
Specialist
Specialist
Author

item 1, item 2 is an example .. length is not fixed

it would be better if i used real names:

HP 3400PDX (test 100000)

CANON FAX 1245 (test 200000)

LINKSYS NAS 4-BAY#

APPLE IPAD2 16GB

brenner_martina
Partner - Specialist II
Partner - Specialist II

OK, I do understand, but now you can play with string functions like this:

field2 includes all possible right values

Left(field,Len(field2)) As field

matt_crowther
Luminary Alumni
Luminary Alumni

The following set of functions against the String give me the results you're looking for as an alternate method:

purgechar(trim(SubField(String,'(',1)),chr(35)) as Clean_String

Where 'String' is your original text.

If you have more permutations they'll have to be added in accordingly.

All the best,

Matt - Visual Analytics Ltd

amien
Specialist
Specialist
Author

Yes, but that is really had to maintain. It could be a list of 100 chars,words. I really need this in a table

brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi, Amien,

is something like this possible?

field2 can be a variable, that you get with peek from another table and loop it

for counter=0 to Number

Let field2 = Peek('Field',$(counter),'Table')

If(Left(field,Len($(field2)))=$(field2),$(field2)) As field

Next