2 Replies Latest reply: Nov 19, 2012 10:36 AM by jagan mohan rao appala RSS

    Need help in scripting...

    Sushil Kumar

      Hi All,

       

      I need help in scripting. to get the data.

       

      I have a table which is resident in the qlikview.

       

      in my table i have many columns and i need to ably group by caluse in some columns. My problem is how do i include the other column in the data. Please help me out to solve this issue.

       

      I am attaching the sample data. I need data for the given order_number, for a given measure which is having the minimum priority.

       

      ORDER_NUMBERMEASURELATE_CODEPRIORITYCREATION_DATEINCLUSION_INDICATORINVENTORY_ORGLATE_CODE_DESCRIPTIONLINE_SCHEDOP_SUB_CATEGORYOPERATIONAL_DESC
      100059998PROMISED18818-01-2011 15:16N050Due date was a holiday/weekend3-1HolidayNon-Operational
      100059998REQUESTED12812-01-2011 12:17N050Other (Requires Comment)1-1OtherOperational
      100059998REQUESTED12825-03-2011 15:13N050Other (Requires Comment)8-1OtherOperational
      100059998REQUESTED181118-01-2011 15:16N050Due date was a holiday/weekend3-1HolidayNon-Operational
      100059998SCHEDULED18318-01-2011 15:16N050Due date was a holiday/weekend3-1HolidayNon-Operational

       

      Final result should be like.

       

      ORDER_NUMBERMEASURELATE_CODEPRIORITYCREATION_DATEINCLUSION_INDICATORINVENTORY_ORGLATE_CODE_DESCRIPTIONLINE_SCHEDOP_SUB_CATEGORYOPERATIONAL_DESC
      100059998PROMISED18818-01-2011 15:16N050Due date was a holiday/weekend3-1HolidayNon-Operational
      100059998SCHEDULED18318-01-2011 15:16N050Due date was a holiday/weekend3-1HolidayNon-Operational
      100059998REQUESTED12825-03-2011 15:13N050Other (Requires Comment)8-1OtherOperational

       

      Please help me out to solve this problem.

       

      Thanks

      Sushil

        • Re: Need help in scripting...
          Vlad Gutkovsky

          Sushil,

           

          The code would look something like this, assuming your first table is called myTable:

           

          myTableFinal:
          LOAD
              ORDER_NUMBER,
              min(PRIORITY) as PRIORITY
          RESIDENT myTable
          GROUP BY ORDER_NUMBER
          ;

          LEFT JOIN (myTableFinal) LOAD
              ORDER_NUMBER,
              PRIORITY,
              MEASURE,
              LATE_CODE,
              PRIORITY,
              CREATION_DATE,
              INCLUSION_INDICATOR,
              INVENTORY_ORG,
              LATE_CODE_DESCRIPTION,
              LINE_SCHED,
              OP_SUB_CATEGORY,
              OPERATIONAL_DESC
          RESIDENT myTable;

          DROP TABLE myTable;

           

          Regards,

          Vlad

          • Re: Need help in scripting...
            jagan mohan rao appala

            Hi,

             

            Try this

             

            INNER JOIN(OriginalResidentTable)

            LOAD

                 ORDER_NUMBER,

                 MEASURE,

                 Min(PRIORITY) AS MinPriority

            Resident OriginalResidentTable

            Group by ORDER_NUMBER, MEASURE;

             

            Hope this helps you.

             

            Regards,

            Jagan.