5 Replies Latest reply: Sep 8, 2016 6:51 AM by Hagen Zimmermann RSS

    Creating a matching database when scripting for later use

    Hagen Zimmermann

      Hello everybody,

       

      I have the following problem, in which you can help me maybe.

       

      I have a database that looks like this:

      Keyword...
      nike
      nike shoes
      nike air max
      adidas
      adidas shoes
      ...


      And a second database, which looks like this:

      Search Query
      ...
      *nike*
      *nike*shoe*
      *adidas*
      ...

       

      To maintain a link between the two databases I need a matching database, which should look like this:

      Search QueryKeyword
      *nike*nike
      *nike*nike shoes
      *nike*nike air max
      *nike*shoe*nike shoes
      *adidas*adidas
      *adidas*adidas shoes
      ...


      Now I tried the following attempts in QlikView script:

       

      Table B:

      Load [Search Query]

      from

      [Y: \ QlikView_Demos \ 08_Suche Reporting \ QV \ Test.xlsx]

      (OOXML, embedded labels, table is Table 2);

       

      Table A:

      Load Keyword

      FROM

      [Y: \ QlikView_Demos \ 08_Suche Reporting \ QV \ Test.xlsx]

      (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');

      Data:

      LOAD

      Keyword

      Resident TableA

      where the Keyword like '$ (search_value)';

      Next

       

      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,

      Hagen