3 Replies Latest reply: Sep 29, 2016 1:42 PM by Rohit Kumar RSS

    Qlik Sense: Store a QVD with a Variable Name

    olga avalos

      Hi Everyone


      In my script I want to store the filename as every day, for example:


      store * from Precio_Crudo_GasNatural_OPEP into 'lib://QVDs/Precio_Crudo_GasNatural_OPEP_$(vFecha).qvd'(qvd);

       

      but the result is :  Precio_Crudo_GasNatural_OPEP_=Now().qvd

       

      and I want to store like that:

       

      Precio_Crudo_GasNatural_OPEP_27/09/2016.qvd

      Precio_Crudo_GasNatural_OPEP_28/09/2016.qvd

      Precio_Crudo_GasNatural_OPEP_29/09/2016.qvd

      etc

       

      I create a variable vFecha=Now()  but how do I use that as part of the filename?


      Thanks.



        • Re: Qlik Sense: Store a QVD with a Variable Name
          Marcus Sommer

          Try this:

           

          let vFecha = date(today(), 'DD.MM.YYYY'); // a slash isn't an allowed char within a filename

           

          - Marcus

          • Re: Qlik Sense: Store a QVD with a Variable Name
            Rohit Kumar

            Hi Olga,

             

            Run the below script you will have your best solution:

             

            => create a new folder connection with name test

            .

            Let vtoday = date(today());

             

            Names:

            LOAD * inline [

            "First name"|"Last name"|Amount|"Has cellphone"

            John|Anderson|100|Yes

            Sue|Brown|80|Yes

            Mark|Carr|60 |No

            Peter|Devonshire|40|No

            Jane|Elliot|20|Yes

            Peter|Franc|10|Yes ] (delimiter is '|');

             

             

            store Names into "lib://test/$(vtoday).qvd"(QVD);

             

             

            Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

             

             

            Rohit Kumar

            • Re: Qlik Sense: Store a QVD with a Variable Name
              Rohit Kumar

              Hi olga,

               

              Please replace only test with your connection name and run the script

               

              Let vtoday = date(today());

              Names:

              LOAD * inline [

              "First name"|"Last name"|Amount|"Has cellphone"

              John|Anderson|100|Yes

              Sue|Brown|80|Yes

              Mark|Carr|60 |No

              Peter|Devonshire|40|No

              Jane|Elliot|20|Yes

              Peter|Franc|10|Yes ] (delimiter is '|');

               

               

              store Names into "lib://test/$(vtoday).qvd"(QVD);