1 Reply Latest reply: Nov 13, 2013 7:58 AM by mark casselman RSS

    Crosstable insideout

    Michael Ionkin

      Hello community




      I want to do the opposite of what the crosstable is doing.

      In 'lTolTypRef' there are only three possible values 10 ; 20 ; 30. These values I want to have as columns:

      Is it possible??


      Cheers chesterluck


      14314317371--Halle D
        • Re: Crosstable insideout
          mark casselman

          Hi chesterluck,


          I was looking for a similar solution on the discussions and found that GENERIC tables are the solution.

          Check blog : http://qlikviewnotes.blogspot.co.uk/2010/05/use-cases-for-generic-load.html


          Rewritten for your use (i hope there are no typo's):


          // Make a generic table for every case


          GENERIC LOAD IJob, IToIRef, 'REF_' & IToITypRef, sDepot

          RESIDENT L9;


          //list all jobs


          LOAD Distinct IJob

          resident YourTableName;


          drop tables YourTableName;


          // join all generic tables


          FOR i = 0 to NoOfTables()


            LOAD TableName($(i)) as Tablename AUTOGENERATE 1

            WHERE WildMatch(TableName($(i)), 'Generic_Tables.*');

          NEXT i


          FOR i = 1 to FieldValueCount('Tablename')

            LET vTable = FieldValue('Tablename', $(i));

            LEFT JOIN (Klanten) LOAD * RESIDENT $(vTable);

            DROP TABLE $(vTable);

          NEXT i


          DROP TABLE TableList;


          Hope this works...