Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Master calendar script required to connect to script

Please share the master calendar script required and what modifications to be made in my original script to connect to the master calendar.

I have date, month and year fields in my original script. How to connect this to the master calendar.

Please share master calendar script and the adjustments to be made to link it to the original script to give correct results.

Thank ypu

4 Replies
Anil_Babu_Samineni

Master Calendar Generation Script

In that, InvoiceDate is your date field.

In that, Calendar your wish to create from calendar dates or that's fine with existing one of Month and Year.

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
luismadriz
Specialist
Specialist

Hi,

I created this process with parameters that created a master calendar for any date field you want and other stuff to facilitate time analysis. Let me know if you need help using it,

My 2 cents on Time Analysis

Cheers,

Luis

sumanta12
Creator II
Creator II

TABLE:

LOAD

Product, 

    Date,

    Sales

FROM

(ooxml, embedded labels, table is Sheet1);

MINMAX:

LOAD

MIN(Date) AS MIN_DATE,

MAX(Date) AS MAX_DATE

RESIDENT TABLE;

LET vMin=PEEK('MIN_DATE',0,'MINMAX');

LET vMax=PEEK('MAX_DATE',0,'MINMAX');

DROP TABLE MINMAX;

TMP_CAL:

LOAD

DATE($(vMin)+ROWNO()+1) AS D

AUTOGENERATE $(vMax)-$(vMin)+1;

CALENDAR:

LOAD

DATE(D)                         AS Date,

DAY(D) AS Day,

MONTH(D) AS Month,

YEAR(D) AS Year,

MONTH(D)&'-'&YEAR(D) AS Month_Year,

'Q'&Num(ceil(month(D)/3)) AS Quarter,

QUARTERNAME(D) AS Quarter_Name,

'W'&right(WeekName(D,0,-4), 2) AS Week,

WEEKSTART(D,0,-4) AS Week_Start_Date,

WEEKEND(D,0,-4) AS Week_End_Date,

MONTHSTART(D) AS Month_Start_Date,

MONTHEND(D) AS Month_End_Date,

QUARTERSTART(D) AS Quarter_Start_Date,

QUARTERSTART(D) AS Quarter_End_Date,

YEARSTART(D) AS Year_Start_Date,

YEAREND(D) AS Year_End_Date

RESIDENT TMP_CAL;

DROP TABLE TMP_CAL;

luismadriz
Specialist
Specialist

Hi,

Just wondering to know how did you go,

Cheers

Luis

When applicable please mark the appropriate replies as Correct. This will help community members know which discussions have already been addressed and have a possible known solution. Please mark replies as Helpful if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as Helpful if you feel additional info is useful to others