Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Selecting data from a qvd file using wildcards

Hi,

I have a need to select data from a QVD file based on the contents of an excel spreadsheet, the added complication is that I need to match only on part of the string, I can build the string from the spreadsheet ok.

Example:

// String build from Spreadsheet

LET String="a like 'fre%' or a like 'ber%'"

In SQL speak I could do

select a, b, c
from table
where ($(String));

Is there a way of doing it from a QVD file ?

Thanks

Tony

1 Solution

Accepted Solutions
Partner
Partner

Hi Tony,

Yes, that would work in SQL but in QV you would need to use MATCH() or WILDMATCH() functions. So something like below should work fine:


let mask1 = chr(39) & 'fre*' & chr(39);
let mask2 = chr(39) & 'ber*' & chr(39);
LET String = 'WILDMATCH(a, ' & mask1 & ') > 0 OR WILDMATCH(a, ' & mask2 & ') > 0' ;
LOAD a FROM a.qvd (qvd)
WHERE $(String);


View solution in original post

3 Replies
Partner
Partner

Hi Tony,

Yes, that would work in SQL but in QV you would need to use MATCH() or WILDMATCH() functions. So something like below should work fine:


let mask1 = chr(39) & 'fre*' & chr(39);
let mask2 = chr(39) & 'ber*' & chr(39);
LET String = 'WILDMATCH(a, ' & mask1 & ') > 0 OR WILDMATCH(a, ' & mask2 & ') > 0' ;
LOAD a FROM a.qvd (qvd)
WHERE $(String);


View solution in original post

Not applicable

The following code should help...

LOAD * FROM FileName.QVD (qvd) WHERE WILDMATCH(FieldName, '*ZZ*');


Not applicable

Thanks That worked perfectly

Tony