Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

wildmatch

hi all,

is their a way to have multiple conditions in wildmatch

for ex: the data as below

Load * Inline[

account,

transtype,

transmovement

amount

]

for the above table i would like to group as following

if(WildMatch(transtype,'*101','*102','*103','*104'),'N-P customer ',

if(WildMatch(transtype,'*99','*98'),'N-P-N customer ',

if(WildMatch(transtype,'*89'),'Unknown customer ', - here need an additional condition --saying that transtype should be 89 starting with and transmovement is 500 and 511

)) as Customer Group

any suggestions

1 Solution

Accepted Solutions
Highlighted

May be this:

If(WildMatch(transtype,'*101','*102','*103','*104'),'N-P customer ',

If(WildMatch(transtype,'*99','*98'),'N-P-N customer ',

If(WildMatch(transtype,'*89') and Match(transmovement, 500, 511),'Unknown customer ')) as Customer Group

View solution in original post

8 Replies
Highlighted

May be this:

If(WildMatch(transtype,'*101','*102','*103','*104'),'N-P customer ',

If(WildMatch(transtype,'*99','*98'),'N-P-N customer ',

If(WildMatch(transtype,'*89') and Match(transmovement, 500, 511),'Unknown customer ')) as Customer Group

View solution in original post

Highlighted
Creator II
Creator II

Hi sunny ,

there is a small chnage.

if(WildMatch(transtype,'*101','*102','*103','*104'),'N-P customer ',

if(WildMatch(transtype,'*99','*98'),'N-P-N customer ',

if(WildMatch(transtype,'*89'),'Unknown customer ',Others' - So here for rest of  the transtype starting with and transmovement should be 500 and 511

)) as Customer Group

Highlighted

transtype starting with??

Highlighted
Creator II
Creator II

it is rest of the others .. there are more than 60-70 transtype codes..but should limit to transmovement be 500 and 511


that is the reason i have put 'others' after


if(WildMatch(transtype,'*89'),'Unknown customer ',Others'

Highlighted

May be this:

If(WildMatch(transtype,'*101','*102','*103','*104'),'N-P customer ',

If(WildMatch(transtype,'*99','*98'),'N-P-N customer ',

If(WildMatch(transtype,'*89'), 'Unknown customer',

If(Match(transmovement, 500, 511), 'Others')))) as Customer Group

Highlighted
MVP
MVP

I think above is the logic you required.

But keep in mind that there might be records for which this expression will return NULL, i.e. records with unspecified [Customer Group].

Just wondering if this is what you want, given the fact that you already have to classses 'unknown customer' and 'Others', so I would expect to use one value to catch everything else, so selecting all classes from [Customer Group] won't remove records.

If(WildMatch(transtype,'*101','*102','*103','*104'),'N-P customer ',

If(WildMatch(transtype,'*99','*98'),'N-P-N customer ',

If(WildMatch(transtype,'*89'), 'Unknown customer',

If(Match(transmovement, 500, 511), 'Others','N/A')))) as [Customer Group]

But maybe that's not required here...

Highlighted
Creator II
Creator II

Hi Both,

It gives output few data.. but Iam waiting from the customer feedback whether the data and calculations  are correct or not .

If(WildMatch(transtype,'*101','*102','*103','*104'),'N-P customer ',

If(WildMatch(transtype,'*99','*98'),'N-P-N customer ',

If(WildMatch(transtype,'*89'), 'Unknown customer',

If(Match(transmovement, 500, 511), 'Others')))) as Customer Group


can you also tell me how to make wildmatch again based on this output


for ex:

f(WildMatch([Customer Group],'*N-P '),'Customers ',

If(WildMatch([Customer Group],'*Unk '),'Unidentified

))) as Customer main Group


i tried to add this in a new resident load statement .but i dont get any values.



Highlighted

May be this in the preceding load:

LOAD *,

          If(WildMatch([Customer Group], 'N-P*'), 'Customers ',

          If(WildMatch([Customer Group], 'Unk*') as 'Unidentified')) as [Customer Main Group];

LOAD *,

          If(WildMatch(transtype,'*101','*102','*103','*104'),'N-P customer ',

          If(WildMatch(transtype,'*99','*98'),'N-P-N customer ',

          If(WildMatch(transtype,'*89'), 'Unknown customer',

          If(Match(transmovement, 500, 511), 'Others')))) as Customer Group

FROM/Resident;

UPDATE: If you got what you were looking for, I would ask you for your time to go in there and close this thread by marking correct and helpful answers. And for new requirements open a new thread.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny