2 Replies Latest reply: Nov 28, 2013 8:30 PM by Srikanth P RSS

    Add date to data in the script


      HI,

      I need to analyze the model by year quarters and months.

      Sales table between 2007 - 2010 and the budget table should be the same every year.

      Can someone show me how to add it to the script?

        • Re: Add date to data in the script
          Srikanth P

          You can create the Year field by : Year(DateField) AS Year

          and Quarter by: Q & Ceil(Month(DateField)/3) AS Quarter

            • Re: Add date to data in the script
              Srikanth P

              Or You can create the Master Calender Table and connected the Calender Table through your Date field.

               

              CALENDAR:

              LOAD DATEFIELD ,

                        Year(DATEFIELD) AS YEAR,

                        Month(DATEFIELD) AS MONTH

                        'Q' & Ceil(Month(DATEFIELD)/3) AS QUARTER,

                        Week(DATEFIELD) AS WEEK

              ;

              LOAD DISTINCT DATEFIELD

              Resident From SALES_TABLE;

               

              You can any other calender fields to CALENDAR table if you need.