Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ajit_aarya
Contributor II
Contributor II

Filtering with respect to specified position in the value of a field

I want to select only specified values in my field

 

As example 

Code

USFYKAU8I

USIKSAU9U

USKJ1SHSW

 

I want only codes which start with US and sixth letter should be A.

I tried this   =If(WildMatch(Code,'US***A***'), Code)

but its giving all fields which has U,S,A in the code and i need only sixth letter A

 

#expressions #logi

Labels (2)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Use the ? wildcard which indicates a single character.

=If(WildMatch(Code,'US???A???'), Code)

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

View solution in original post

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Use the ? wildcard which indicates a single character.

=If(WildMatch(Code,'US???A???'), Code)

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

ajit_aarya
Contributor II
Contributor II
Author

That works, Thanks

ajit_aarya
Contributor II
Contributor II
Author

@rwunderlich 

 I want only codes which start with US and sixth letter should be A.

Exclude

I also want to eliminate letter U on ninth position

If(WildMatch(Code,'US??????U'),'Unspecified') --- condition to exclude code ends with U i guess

 

=If(WildMatch(Code,'US???A???',If(WildMatch(Code,'US???A???','Unspecified'), Code)

Is it works 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I might write it as:

=If(WildMatch(Code,'US???A???') and not Mid(Code,9,1) = 'U', Code, 'Unspecified')

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com