4 Replies Latest reply: Aug 8, 2014 6:14 AM by Андрей Шепель RSS

    Max sales date in LoadCript

    Андрей Шепель

      Good day!

      In pivot table "Max sales date" i calculate max date by Spoints, where quantity > 0

       

      My question: How can i write the same in loadscript to load in one table field Spoint and their Max sales dates (quantity > 0) ?

       

      Thank you!

        • Re: Max sales date in LoadCript
          Tresesco B

          Input:
          LOAD * INLINE [
              Quantity, Spoint, ProductType, Date
              0,  point 1, type1,21-09-2014
              12, point 2,type2, 22-09-2014
              33, point 3,type3, 23-09-2014
              44, point 5,type4, 22-09-2014
              55, point 6,type1, 21-09-2014
              67, point 7,type5, 24-09-2014
              99, point 8,type7, 25-09-2014
              00, point 9,type3, 26-09-2014
              33, point 4,type4, 21-09-2014
              334, point 10,type1, 22-09-2014
              3, point 1,type1, 21-10-2014
              0, point 2,type1, 22-12-2014
              34, point 3,type1, 23-12-2014
              0, point 5,type1, 22-12-2014
              56, point 6,type1, 21-12-2014
              12, point 7,type3, 24-03-2014
              1, point 8,type1, 25-07-2014
              00, point 9,type1, 26-11-2014
              21, point 4,type1, 21-12-2014
              12, point 10,type1, 23-09-2014
          ];

          Join
          Load
          Spoint,
          Date(Max(Date))
          Resident Input Where Quantity>0 Group By Spoint;

           

           

          PFA

          • Re: Max sales date in LoadCript
            jagan mohan rao appala

            Hi,

             

            Try like this

             

            Data:

            LOAD * INLINE [

                Quantity, Spoint, ProductType, Date

                0,  point 1, type1,21-09-2014

                12, point 2,type2, 22-09-2014

                33, point 3,type3, 23-09-2014

                44, point 5,type4, 22-09-2014

                55, point 6,type1, 21-09-2014

                67, point 7,type5, 24-09-2014

                99, point 8,type7, 25-09-2014

                00, point 9,type3, 26-09-2014

                33, point 4,type4, 21-09-2014

                334, point 10,type1, 22-09-2014

                3, point 1,type1, 21-10-2014

                0, point 2,type1, 22-12-2014

                34, point 3,type1, 23-12-2014

                0, point 5,type1, 22-12-2014

                56, point 6,type1, 21-12-2014

                12, point 7,type3, 24-03-2014

                1, point 8,type1, 25-07-2014

                00, point 9,type1, 26-11-2014

                21, point 4,type1, 21-12-2014

                12, point 10,type1, 23-09-2014

            ];

             

             

            LEFT JOIN(Data)

            Load

            Spoint,

            Date(Max(Date)) AS MaxDate

            Resident Data

            Where Quantity>0

            Group By Spoint;

             

            Hope this helps you.

             

            Regards,

            jagan.