13 Replies Latest reply: May 9, 2011 5:04 PM by Jared Wisham RSS

    Export by Dimension

      When dealing with large data structures, it seems like an 'Export' option is really only viable if the dataset is within the limitations of the format it is exporting to.. for example, newer version of Excel only support up to 1.1 million rows, and previous versions were only compatible up to 65k or so (memory ceilings I assume).

       

      That said, it seems like a great solution would be the ability to auto-export a table to a format automatically in the script itself.

       

      If I have a pre-built QVD that I want to divide into 3 separate exports (let's just say for argument's sake that it's by 'DIM1' dimension - or a specific site/location), what would be the method to have QlikView script do such a thing?  How do you script a loop to only export the values in the 'current' dimension it is on until it has divded up the table into each respective individual dimension tables?

        • Export by Dimension
          Erich Shiino

          Hi,

          If you check my post at this thread:

          http://community.qlik.com/message/113679#113679

          There is a sample application to make selections on a field one by one and export a chart to word.

           

          Inside the For-Next structure you could include a different export method according to your need.

          Tell if you need some help to understand or adapt it.

           

          Regards,

           

          Erich

          • Export by Dimension
            Ralf Becher

            Hi,

             

            I presume that you want to use STORE to a TXT (csv) file in the script. The only way I see is to load each part you want to export to a second table with a filter where clause:

             

            temp:

            LOAD *

            FROM xyz.qvd (qvd)

            Where dimension = 'DIM1';

             

            STORE temp INTO dim1export.txt (txt);

             

            DROP Table temp;

             

            // repeat for DIM2 to DIM3, you could also have a loop here

             

            - Ralf

            • Export by Dimension

              So, a combination of what you BOTH said seems more appropriate.  Part of that has to do with my explanation of the issue, and expected output I'm looking for:

               

              1.  Erich - Your FOR loop looks like it checks for all possible values in a given field, and moves through them until all of the possible field values have been dealt with.  This portion is exactly the kind of behavior I was looking to do...

               

              2.  Ralf - You actually had the exact output and concept I was looking for (where Erich was doing more of an immediate export to Word or similar app).

               

              Now, I need to figure out a way to combine the two concepts... I think with this I should be able to collectively put it together.  If I come up with an exact step-by-step walkthrough, I will most certainly come back and post it. 

               

              Just going to take some time, tweaking, and a little more referencing of the scripting language capabilities.