Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kaygee28
Contributor III
Contributor III

Master Calendar Not Working

Hi, I know this question must have have been asked a million times but I am currently struggling for some reason with my master calendar which isn't working not sure why it isn't displaying anything for the day, month, week, year and quarter.

here is my code below, I thought I have everything required:

FIrst_Base:

LOAD

     Sales,

     date(Date#(SalesDate,'DD/MM/YYYY')) as SalesDate,

     C,

     D

FROM

Sales.xlsx

(ooxml, embedded labels, table is Sheet1);    

    

Mas_Cal:

LOAD

Date(SalesDate) as SalesDate,

Year(SalesDate) as Year,

'Q' & Ceil(Month(SalesDate)/3) as Quarter,

Month(SalesDate) as Month,

Day(SalesDate) as Day,

Week(SalesDate) as Week;

Recu_Load:

Load

Date(MinDate + Iterno() -1) as SalesDate

While(MinDate + Iterno() -1)<=Num(MaxDate);

Additional:

Load

Min(date(Date#(SalesDate,'DD/MM/YYYY'))) as MinDate,

Max(date(Date#(SalesDate,'DD/MM/YYYY'))) as MaxDate

Resident FIrst_Base;

1 Solution

Accepted Solutions
sunny_talwar

May be this:

FIrst_Base:

LOAD

    Sales,

    Date(Date#(SalesDate,'DD/MM/YYYY')) as SalesDate,

    C,

    D

FROM

Sales.xlsx

(ooxml, embedded labels, table is Sheet1);  

  

Mas_Cal:

LOAD Date(SalesDate) as SalesDate,

          Year(SalesDate) as Year,

          'Q' & Ceil(Month(SalesDate)/3) as Quarter,

          Month(SalesDate) as Month,

          Day(SalesDate) as Day,

          Week(SalesDate) as Week;

LOAD Date(MinDate + Iterno() -1) as SalesDate

While(MinDate + Iterno() -1)<=Num(MaxDate);

LOAD Min(SalesDate) as MinDate,

          Max(SalesDate) as MaxDate

Resident FIrst_Base;

If it still doesn't work, I would suggest you to check this and make sure SalesDate actually came in as DD/MM/YYYY

Date(Date#(SalesDate,'DD/MM/YYYY')) as SalesDate,

View solution in original post

2 Replies
sunny_talwar

May be this:

FIrst_Base:

LOAD

    Sales,

    Date(Date#(SalesDate,'DD/MM/YYYY')) as SalesDate,

    C,

    D

FROM

Sales.xlsx

(ooxml, embedded labels, table is Sheet1);  

  

Mas_Cal:

LOAD Date(SalesDate) as SalesDate,

          Year(SalesDate) as Year,

          'Q' & Ceil(Month(SalesDate)/3) as Quarter,

          Month(SalesDate) as Month,

          Day(SalesDate) as Day,

          Week(SalesDate) as Week;

LOAD Date(MinDate + Iterno() -1) as SalesDate

While(MinDate + Iterno() -1)<=Num(MaxDate);

LOAD Min(SalesDate) as MinDate,

          Max(SalesDate) as MaxDate

Resident FIrst_Base;

If it still doesn't work, I would suggest you to check this and make sure SalesDate actually came in as DD/MM/YYYY

Date(Date#(SalesDate,'DD/MM/YYYY')) as SalesDate,

kaygee28
Contributor III
Contributor III
Author

It worked you're really good Sunny T!!!

so this was actually the problem

Load
Min(date(Date#(SalesDate,'DD/MM/YYYY'))) as MinDate,
Max(date(Date#(SalesDate,'DD/MM/YYYY'))) as MaxDate
Resident FIrst_Base;