8 Replies Latest reply: Jun 18, 2016 1:36 AM by kushal chawda RSS

    loading data

    qvhelp please

      Hi All,

       

      I have a excel with headers of data , text file with all the data without headers ,how can i load this data into qlikview .any ideas ?

      gwassenaarswuehlkush141087maxgrorwunderlichmrkachhiaimpstalwar1sorrakis01

        • Re: loading data
          Clever Anjos

          Would you mind sharing sample of your files?

          • Re: loading data
            Stefan Wühl

            Load your text file with option 'none' for labels, this will create a load like

             

            Table:

            LOAD @1,

                 @2,

                 @3,

                 @4,

                 @5,

                 @6,

                 @7,

                 @8,

                 @9,

                 @10,

                 @11

            FROM

            [C:\Users\Stefan\Downloads\StoreTest.txt]

            (txt, utf8, no labels, delimiter is ',', msq);

             

             

            Do the similar for the header file, using an additional RecNo() as ID and a CROSSTABLE LOAD prefix, something like

             

            CROSS:
            CROSSTABLE (Header, FieldName)

            LOAD Recno() as ID,

                 @1,

                 @2,

                 @3,

                 @4,

                 @5,

                 @6,

                 @7,

                 @8,

                 @9,

                 @10,

                 @11

            FROM

            [C:\Users\Stefan\Downloads\Header.txt]

            (txt, utf8, no labels, delimiter is ',', msq)

            ;

             

            Then create a MAP:

             

            MAP:

            MAPPING

            LOAD Header, FieldName

            RESIDENT CROSS;

             

            And then rename your original fields:

             

            RENAME FIELDS USING MAP;

            • Re: loading data
              kushal chawda

              try this as well

               

               

              Map_Field:
              Mapping LOAD '@'&RecNo() as FieldFrom,
                           
              @1 as FieldTo   
              FROM
              [C:\Users\kush\Downloads\Header.xlsx]
              (
              ooxml, no labels, table is Sheet1, filters(
              Transpose()
              ));


              Data:
              LOAD @1,
              @2,
              @3,
              @4,
              @5,
              @6,
              @7,
              @8,
              @9,
              @10,
              @11,
              @12,
              @13,
              @14,
              @15,
              @16,
              @17,
              @18,
              @19,
              @20,
              @21,
              @22,
              @23,
              @24,
              @25,
              @26,
              @27,
              @28,
              @29,
              @30,
              @31,
              @32
              FROM
              [C:\Users\kush\Downloads\transdata.txt]
              (
              txt, codepage is 1252, no labels, delimiter is '\t', msq);


              RENAME Fields using Map_Field;