2 Replies Latest reply: Jan 8, 2013 3:13 AM by Mathias Vanden Auweele RSS

    Dynamic HTML table selection

    Mathias Vanden Auweele

      Dear all,

       

      I am using Qlikview in order to load tables from an intraweb source (for which it is difficult to get direct database access). the problem is that the table reference in Qlikview is not constant. It can sometimes be @20, sometimes @19 and sometimes @21. Luckily the table always contains a fixed number of columns so I can do an if/else analysis after loading the table.

       

      Is there a way to load all the properties of the tables on one internet page in QV? Properties like: nr. of rows, nr. of columns?

       

      thank you

        • Re: Dynamic HTML table selection
          Daniel Rozental

          Why don't you cicle through each table and then drop the ones you don't need.

           

          set ErrorMode  = 0;
          
          
          for i = 1 to 100
          
          
                    Table1:
                    LOAD *
                    FROM
                    [http://community.qlik.com]
                    (html, codepage is 1252, embedded labels, table is @$(i));
          
                    Let vRows = NoOfRows('Table1');
                    if vRows <> 10 then
                              drop table Table1;
                    ELSE
                              exit for;
                    endif
          
          
          next
          
          
          set ErrorMode  = 1;
          
          
            • Re: Dynamic HTML table selection
              Mathias Vanden Auweele

              Dear Daniel,

               

              Thank you for your answer. Unfortunately, I have to loop over 10.000 html pages (dynamically generated) containing some 40 rather extensive tables. Loading them all is not an option 'cause that will take all day

               

              At the moment, I'm doing some 'educated guesses' and load three tables which are the most likely and check if any of thoose correspond.