3 Replies Latest reply: Nov 3, 2015 10:52 AM by Fabio Mazzarelli RSS

    Loop

    Fabio Mazzarelli

      Hi Community,

       

      I copied a script called inc qvd-qvd loop.qvf

      but it doesn't work.

       

      My path is: C:\QLIK SENSE SAMPLE DATA\data sources\qvd\

      variable d = users

       

      what am I missing?

       

      I expect Immagine.png

        • Re: Loop
          Fabio Mazzarelli

          Hi Community,

           

           

          I stepped forward . Now , I need to understand why the value of d is users but the result is a created file named $(d).qvd

           

          Immagine.png

            • Re: Loop
              Oleg Troyansky

              This is just a hunch, but it looks like the $-sign that appears after a back-slash '\' is treated literally as a string $ and not as a $-sign expansion. Questions to consider:

               

              1. Do you need 2 forward-slash characters? I think you should be fine with this:

               

              $(vDataDir)$(d) , considering that the variable vDataDir is ending with a forward slash.

               

              2. Perhaps you could build the whole path and file name as a single variable before the load and therefore eliminate any possibility of a confusion.

               

              cheers,

              Oleg Troyansky

              Check out my new book QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense

                • Re: Loop
                  Fabio Mazzarelli

                  Hi,

                   

                  it seems correct debugging it but fhe files created are uncorrect.

                   

                  Why the extension is .qvf.

                  and

                  Why the name is $(d).

                   

                   

                   I do not understand. The folder contains files users.qvf and $(d) .qvd .

                   

                  Immagine.png

                  //STORE TABLES AS QVD

                  SET vDataDir = 'lib://qvd data/';

                  for i=0 to NoOfTables()-1

                    LET d= TableName(i);

                    STORE $(d) into $(vDataDir)$(d).qvd;

                  NEXT

                  LET j = NoOfTables();

                  do while j > 0

                    let d = TableName(0);

                    drop table $(d);

                    let j = NoOfTables();

                  loop