2 Replies Latest reply: Feb 5, 2013 8:41 AM by Bill Britt RSS

    how to create a month

    Chinna Reddy

      I am having the field calender week from this one i need to create month how to do it

        • Re: how to create a month
          khadar basha

          hi,

           

             can you please provide sample data.

           

           

           

          Regards

           

          • Re: how to create a month
            Bill Britt

            Do you have a field that contains a date? If so then the below should work.

             

            Month(Fieldname) as Month,

             

             

             

            Orders:

             

             

            LOAD

            applymap('Shippers_Map', ShipperID, 'MISSING') as Shipper,

            ShipperID,

            CustomerID,

               
            EmployeeID,

               
            EmployeeID as EmployeeSalesID,

               
            Freight,

               
            OrderDate,

               
            Month(OrderDate) as Month,

               
            Year(OrderDate) as Year,

               
            Day(OrderDate) as Day,

               
            applymap('Quarters_Map', num(Month(OrderDate)), Null()) as Quarter,

               
            date(monthstart(OrderDate),'MMM-YYYY') as MonthYear,

               
            OrderID,

                1
            as OrderIDCounter

            ;

            SQL SELECT *

            FROM Orders

            order by OrderDate ASC;

             

             

             

            Bill