Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
TracyRoberts
Contributor
Contributor

Filter in Data Load

I am trying to filter data

where my Customer Account Code starts with Y3XCH???????? and

does not end with a C, S or H

i.e. Y3XCHABCDEFG will be included, but Y3XCHABCDEFGHC won't be included

Counting those included as 1 and those not included as 0

I am using :

Wildmatch("Customer Account Code",'Y3XCH*') and 
    Not Match(Right("Customer Account Code",1) = 'C' or
    Not Match(Right("Customer Account Code",1) = 'S' or
    Not Match(Right("Customer Account Code",1) = 'H'),1,0) as Hub4Filter,

But it is totally omitting all Y3XCH*

Can anyone help please.....

Labels (1)
  • SaaS

2 Solutions

Accepted Solutions
Taoufiq_Zarra

Hi,

you forgot brackets

Not Match(Right("Customer Account Code",1)

and I think you'll replace OR  with an and


Because for example if I take "Y3XCHABCDEFGHC" the first condition is OK "YXCH" for the second condition it is enough that one is correct for example it does not end with "S" so "Y3XCHABCDEFGHC" is added while its must not .

try this one

if(Wildmatch([Customer Account Code], 'Y3XCH*')>0 and 
(
Wildmatch([Customer Account Code], '*C')=0 and
Wildmatch([Customer Account Code], '*S')=0 and
Wildmatch([Customer Account Code], '*H')=0
)
,1,0) as Hub4Filter,

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

TracyRoberts
Contributor
Contributor
Author

Thank you so much, that works.

Wish I'd come on here two days ago !!!

View solution in original post

2 Replies
Taoufiq_Zarra

Hi,

you forgot brackets

Not Match(Right("Customer Account Code",1)

and I think you'll replace OR  with an and


Because for example if I take "Y3XCHABCDEFGHC" the first condition is OK "YXCH" for the second condition it is enough that one is correct for example it does not end with "S" so "Y3XCHABCDEFGHC" is added while its must not .

try this one

if(Wildmatch([Customer Account Code], 'Y3XCH*')>0 and 
(
Wildmatch([Customer Account Code], '*C')=0 and
Wildmatch([Customer Account Code], '*S')=0 and
Wildmatch([Customer Account Code], '*H')=0
)
,1,0) as Hub4Filter,

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
TracyRoberts
Contributor
Contributor
Author

Thank you so much, that works.

Wish I'd come on here two days ago !!!