Discussion Board for collaboration on QlikView Scripting.
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.
// String build from Spreadsheet
LET String="a like 'fre%' or a like 'ber%'"
In SQL speak I could do
select a, b, cfrom tablewhere ($(String));
Is there a way of doing it from a QVD file ?
Go to Solution.
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);
The following code should help...
LOAD * FROM FileName.QVD (qvd) WHERE WILDMATCH(FieldName, '*ZZ*');
Thanks That worked perfectly