1 Reply Latest reply: Mar 28, 2017 9:24 AM by Aar Kay RSS

    Transform a table

    Lars Sjögren

      Hi

       

      I have imported a Table from a RavenDB(document DB) via Qlik Rest Connector.

      I Think a have a Customer table that looks like my example below.

       

      Age and Gender on different rows.  What is the best way to handle  the situation?

       

      Regards Lars

       

          

      NrNameCityAgeGender
      1OlaLerum23
      2OlaLerum Male
      3PeterAvesta25
      4PeterAvesta Male
      5KristinaBjuv27
      6KristinaBjuv Female
        • Re: Transform a table
          Aar Kay

          May be this:

          Table:

          load * inline [ 

          Nr, Name, City, Age, Gender

          1, Ola, Lerum, 23,

          2, Ola, Lerum, ,Male,

          3, Peter, Avesta, 25,

          4, Peter, Avesta, ,Male

          5, Kristina, Bjuv, 27,

          6, Kristina, Bjuv, ,Female

          ];

           

           

           

           

          FinalTable:

          Load

                 Name,

                 City,

                 Age

          Resident

                Table

          Where

                 len(Age)>0;

           

           

          Left Join (FinalTable)

          Load

                 Name,

                 City,

                 Gender

          Resident

                 Table

          Where

                 len(Gender)>0;

          Drop Table

                 Table;