5 Replies Latest reply: Jul 4, 2018 10:31 AM by Ray Del Rio RSS

    Line Up 2 Rows from 2 Columns

    Ray Del Rio

      I have loaded a table where two column/row combinations need to be displayed next to each other.

       

      Actual Qlik Table Result

      IDField TypeField String Value Field Date Value
      1TypeStartednull
      1Datenull6/15/18

       

      I would like to get a result in a qlik table like this:

       

      ID1Field String ValueField Date Value
      1Started6/15/18

       

      The 2 rows in the first example share the same ID#. 


      Do I have any options of:

       

      1. Displaying the result in my 2nd table above.
      2. Getting to a place where I can assign the "Field Date Value" to the "Field String Value" dimension.


      I am stuck on this one and wanted to ask the community since I am missing something here.

       

      Thanks!

        • Re: Line Up 2 Rows from 2 Columns
          Ray Del Rio

          I can't seem to get this working using crosstable.

           

          Any ideas?

          • Re: Line Up 2 Rows from 2 Columns
            kaan erisen

            Hi Ray,

             

            If you want to manage this on script side, you can use group by with maxstring function for the fields.

             

            load

            ID,

            MaxString("Field String Value") as "Field String Value",

            MaxString("Field Date Value") as "Field Date Value"

            Inline [

            ID,"Field Type","Field String Value","Field Date Value"

            1,'Type','Started',

            1,'Date',,'6/15/18'

            ]

            group by ID;

            Untitled.png

            Untitled2.png

             

            If you want to achieve this on front end, You can add measures to your table with maxstring function.

              • Re: Line Up 2 Rows from 2 Columns
                Ray Del Rio

                Thanks for this but what about if there are multiple Types/Dates for the same ID?

                 

                 

                ID  Field Type   Field String Value    Field Date Value
                1    Type            Started                   
                1    Date                                            6/15/18
                1    Type            Ended
                1    Date                                             6/20/18

                 

                How would I handle this?