Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
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
transtype starting with??
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'
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
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...
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.
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