Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

change master calendar Quarter Values?

Hello all,

I want the 4 quarters to represent the seasons, so to assign June, July, August to Q1 , September, October, November to Q2 , etc.

I want to check for seasonal trend.  Can this happen?

 

 

Thanks, 

Ioanna

1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

Hi,

create an inline table with month and season quarter and apply it to your datas.

Season_Map:

mapping 

load * inline [

month, season_quarter

1, Q3

2, Q3

3, Q4

4, Q4

5, Q5

6, Q1

7, Q1

8, Q1

9, Q2,

10, Q2,

11, Q2,

12, Q3

];

the use

applymap('Season_Map',num(month(date))) as Season_Quarter

in your master calender

Regards

View solution in original post

3 Replies
martinpohl
Partner - Master
Partner - Master

Hi,

create an inline table with month and season quarter and apply it to your datas.

Season_Map:

mapping 

load * inline [

month, season_quarter

1, Q3

2, Q3

3, Q4

4, Q4

5, Q5

6, Q1

7, Q1

8, Q1

9, Q2,

10, Q2,

11, Q2,

12, Q3

];

the use

applymap('Season_Map',num(month(date))) as Season_Quarter

in your master calender

Regards

ioannagr
Creator III
Creator III
Author

Coooooool!

Got it, thanks!!!!

ioannagr
Creator III
Creator III
Author

My master calendar looks like this:

 

 

 

 

QuartersMap:

MAPPING LOAD

rowno() as Month,

'Q' & Ceil (rowno()/3) as Quarter


AUTOGENERATE (12);

Temp:

Load

min(creation) as minDatecreation,

max(creation) as maxDateCreation

Resident hbtsCoverages;

Let varMinDateCreation = Num(Peek('minDateCreation', 0, 'Temp'));

Let varMaxDateCreation = Num(Peek('maxDateCreation', 0, 'Temp'));

DROP Table Temp;

TempCalendar:

LOAD

$(varMinDateCreation ) + Iterno()-1 As Num,

Date($(varMinDateCreation) + IterNo() - 1) as TempDate

AutoGenerate 1 While $(varMinDateCreation) + IterNo() -1 <= $(varMaxDateCreation);

MasterCalendar:

Load

TempDate AS creation,

week(TempDate) As WeekCreation,

Year(TempDate) As YearCreation,

Month(TempDate) As MonthCreation,

Day(TempDate) As DayCreation,

YeartoDate(TempDate)*-1 as CurYTDFlagCreation,

YeartoDate(TempDate,-1)*-1 as LastYTDFlagCreation,

inyear(TempDate, Monthstart($(varMaxDateCreation)),-1) as RC12Creation,

date(monthstart(TempDate), 'MMM-YYYY') as MonthYearCreation,

ApplyMap('QuartersMap', month(TempDate), Null()) as QuarterCreation,

Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYearCreation,
WeekDay(TempDate) as WeekDayCreation,

WeekDay(TempDate) as DayOftheWeekCreation,
week(TempDate) As WeekTestCreation,
Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYearTestCreation


Resident TempCalendar

Order By TempDate ASC;

Drop Table TempCalendar;

 

 

 

where should i apply  applymap?