Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ravikumar_iyana
Contributor

I want to create a flags in the field values

Hi ,

you can please help me , I have a field name "rate".

I want to create a flag for in a field rows

  1. Startig the field with "1" means i will show to "Born by Company".
  2. Startig the field with "2" means i will show to "Born by vendor"
  3. Remaining same numbers will display.

rate

1d
1e
1c
2a
2g
2k
4
5

Thanks,

Ravi.

1 Solution

Accepted Solutions
YoussefBelloum
Esteemed Contributor

Re: I want to create a flags in the field values

I don't know what is missing with pick wildmatch..

try this:

if(wildmatch(rate,'1*'),'Born by Company',if(wildmatch(rate,'2*'),'Born by vendor',rate)) as rate

17 Replies
YoussefBelloum
Esteemed Contributor

Re: I want to create a flags in the field values

Hi,

on the script try this:

pick(wildmatch(rate,'1*','2*')+1,'Born by Company','Born by vendor',rate) as rate

ravikumar_iyana
Contributor

Re: I want to create a flags in the field values

Its working only '1*' but its not working '2*'

pick(wildmatch(rate,'1*','2*')+1,'Born by Company','Born by vendor',rate) as rate

Thanks for your response.

sureshqv
Esteemed Contributor III

Re: I want to create a flags in the field values

match.PNGtry this

A:

load *,

Pick(WildMatch(rate, '1*', '*2*','*'), 'Born by Company', 'Born by vendor',rate) as Highest ;

load * Inline [

rate

1d

1e

1c

2a

2g

2k

4

5

];

YoussefBelloum
Esteemed Contributor

Re: I want to create a flags in the field values

I don't know what is missing with pick wildmatch..

try this:

if(wildmatch(rate,'1*'),'Born by Company',if(wildmatch(rate,'2*'),'Born by vendor',rate)) as rate

YoussefBelloum
Esteemed Contributor

Re: I want to create a flags in the field values

Hi sureshqv‌,

using pick(wildmatch(...)+1 for the ELSE part don't work ??

sureshqv
Esteemed Contributor III

Re: I want to create a flags in the field values

yes its not picking as expected   

may help us

If wildmatch doesn't match anything it will return 0. And you specified only one match pattern. Pick starts at 1, so feeding pick a 0 won't give a result.

YoussefBelloum
Esteemed Contributor

Re: I want to create a flags in the field values

I was talking about this:

pick(wildmatch(rate,'1*','2*')+1,'Born by Company','Born by vendor',rate) as rate

sureshqv
Esteemed Contributor III

Re: I want to create a flags in the field values

for me also its not working   some versions its working it seems  i will try in other version and get back to you.

YoussefBelloum
Esteemed Contributor

Re: I want to create a flags in the field values

Thank you