Discussion Board for collaboration on QlikView Scripting.
I have the following problem, in which you can help me maybe.
I have a database that looks like this:
And a second database, which looks like this:
To maintain a link between the two databases I need a matching database, which should look like this:
Now I tried the following attempts in QlikView script:
Load [Search Query]
(OOXML, embedded labels, table is Table 2);
(OOXML, embedded labels, table is Table 1);
LET vZeilenanzahl = NoOfRows ( 'TableB');
FOR i = 0 to $ (vZeilenanzahl) -1
LET search_value = peek ( '[Search Query]', $ (i), 'TableB');
where the Keyword like '$ (search_value)';
And so I get at least a database "data", which provides me the right part, the Keywords, of the matching database correctly. Unfortunately I do not get the Search queries in the Table.
Do you know a solution for this?
Possibly is my whole approach incorrect and / or there is a much easier way :-)
Thank you for your help and best regards,
Go to Solution.
try to store the search value in your table Data as well
'$ (search_value)' as Search_Value,
A way uglier solution than Rudolf's (depending on your source tables, it may require quite a lot of RAM), but it avoids using FOR loops. I don't use them if iI don't need to. They're slow.
WHERE WildMatch(Keyword, [Search Query]);
DROP Table TempTable;
Outer Join([Table A])
Resident [Table A]
Where WildMatch(Keyword,[Search Query])>0;
Drop Table [Table A];
another option could be (PFA)
LOAD Keyword as K, rowno() as IdK
(html, codepage is 1252, embedded labels, table is @1);
LOAD [Search Query] as S, rowno() as IdS
(html, codepage is 1252, embedded labels, table is @2);
NoConcatenate LOAD K as K Resident K;
join (T) LOAD S Resident S;
//K like '*' & S & '*' as M1,
//wildmatch(K, '*' & S & '*') as M2
Where wildmatch(K, '*' & S & '*');
DROP Table T;
Thanks to all for the quick and very qualified replies :-)
Now my script works perfectly!