Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Denzyl
Contributor II
Contributor II

Filter data from an ODBC database by string slicing

When loading a table from an ODBC, I would like to filter the dataset based on a column that ends with a certain value.

I have a column [code] that is made up of various text of different length.

I am trying to filter all the rows that does not have a [code] ending with AP.

I tried the following code but it does not work

Denzyl_0-1662109305053.png

 

Labels (1)
1 Solution

Accepted Solutions
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

In the documentation we have all operator you can use : https://help.qlik.com/en-US/sense/August2022/Subsystems/Hub/Content/Sense_Hub/LoadData/Filter-data-c...

 

Perhaps with : code NOT LIKE '%AP'

Example with my data on snowflake

amartinez35_0-1662121703704.png

 

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

4 Replies
SunilChauhan
Champion
Champion

use Below

 

Wildmatch( FIeldName,'*AP')

or 

If(WildMatch(FIeldName,'*AP'),FIeldName) as Test.

 

See the attached Example where we want to filter  Date where we have 22 in END 

Sunil Chauhan
Denzyl
Contributor II
Contributor II
Author

Hi, I've tried to use Wildmatch, and it did not work as well.

Just to be clear I am trying to use the Filter data option in the "Edit Selections" page when loading data from an ODBC connection not trying to write the loading script, using the load editior.

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

In the documentation we have all operator you can use : https://help.qlik.com/en-US/sense/August2022/Subsystems/Hub/Content/Sense_Hub/LoadData/Filter-data-c...

 

Perhaps with : code NOT LIKE '%AP'

Example with my data on snowflake

amartinez35_0-1662121703704.png

 

Help users find answers! Don't forget to mark a solution that worked for you!
Timario
Contributor III
Contributor III

Hi, in filter try use keyword like
right(code,2) like 'AP%'.  It means that 2first symbols of code start with AP. 
right(code,2) like '%AP%'. It means that 2first symbols of code has AP.
right(code,2) like 'AP%'. It means that 2first symbols of code  end AP.