4 Replies Latest reply: Jan 19, 2017 1:07 AM by anjani divi RSS

    Calendar Date shows as number in master calendar

    Nitin Jadhav

      Hi,

      I have used example of master calendar and created application to show datewise sales.

      but my date is showing as number instead of DD/MM/YY format.

       

       

      Following is the code I used to create calendar.

       

      QuartersMap: 
      MAPPING LOAD  
      rowno() as Month, 
      'Q' & Ceil (rowno()/3) as Quarter 
      AUTOGENERATE (12); 
           
      Temp: 
      Load 
      min(PROCS_DATE) as minDate, 
      max(PROCS_DATE) as maxDate 
      Resident SalesData; 
           
      Let varMinDate = Num(Peek('minDate', 0, 'Temp')); 
      Let varMaxDate = Num(Peek('maxDate', 0, 'Temp')); 
      DROP Table Temp; 
           
      TempCalendar: 
      LOAD 
      $(varMinDate) + Iterno()-1 As Num, 
      Date($(varMinDate) + IterNo() - 1) as TempDate 
      AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate); 
           
      MasterCalendar: 
      Load 
        TempDate AS OrderDate, 
        week(TempDate) As Week, 
        Year(TempDate) As Year, 
        Month(TempDate) As Month, 
        Date(MonthStart(TempDate), 'MMM-YYYY') as [Month Year],
        Day(TempDate) As Day, 
        ApplyMap('QuartersMap', month(TempDate), Null()) as Quarter, 
        Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear, 
        WeekDay(TempDate) as WeekDay 
      Resident TempCalendar 
      Order By TempDate ASC; 
      Drop Table TempCalendar;