1 Reply Latest reply: Jan 25, 2018 2:45 PM by Kaushik Solanki RSS

    Store into CSV with a file per Row?

    Steve Fewster

      Hi All,

       

      I'm looking to output a csv from a table in Qlik using the store command, but want a file per row in my table.

       

      CustomerValueQty
      ABC0011000100
      DEF001200020
      XYZ0011500150

       

      So in the example above, I'd like to output 3 csv files, ideally with the Customer Column as the file name.

       

      Any suggestions welcome.

       

      Regards,

      Steve

        • Re: Store into CSV with a file per Row?
          Kaushik Solanki

          Hi,

           

          Try this.

           

          Temp:

          Load Distinct Customer From XYZ;

           

          Let vCount = noofrows('Temp');

           

          For i=0 to $(vCount)-1

           

          Let vCustomer = peek('Customer',$(i),'Temp');

           

          $(vCustomer):

          Load * from xyz where Customer = $(vCustomer);

           

          Store $(vCustomer) into $(vCustomer).csv(txt);

          Drop Table $(vCustomer);

           

          Next

           

          Drop table Temp;

           

          Regards,

          Kaushik Solanki