Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
Coooooool!
Got it, thanks!!!!
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?