Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Bonjour à tous,
Je rencontre un petit soucis avec les calendriers sur QS, 2020 étant une année à 53 semaines , le 1er , le 2 et le 3 Janvier 2021 se retrouvent en S53, et donc la S01 de 2021 débute au 4 Janvier, est ce qui'l y a une possibilité de dire que la S1 débute au 1 er Janvier et donc bypasser la S53 ?
Par avance merci et bonne journée.
Barba
Hi,
Try to implment Master Calendar with below script.
[Calendar]:
SET vFiscalYearStartMonth = 4;
LET vStartDate = NUM(Makedate(2018,01,01));
LET vEndDate = NUM(FLOOR(Makedate(2021,07,31)));
Calendar:
LOAD * ,
DUAL('Q' & CEIL(FiscalMonth/3), Ceil(FiscalMonth/3)) as FiscalQuarter, // Fiscal Calendar Quarter
DUAL(TEXT(DATE(MONTHEND(CalDate1), 'MMM')), FiscalMonth) as FiscalMonthName; // Fiscal Calendar Month Name
LOAD * ,
DATE(NUM(CalDate1)) as "DATE",
DATE(CalDate1) as DATE1,
YEAR(CalDate1) as CalYear, // Standard Calendar Year
MONTH(CalDate1) as CalMonth,// Standard Calendar Month
DATE(CalDate1, 'YYYY-MM') as CalPeriod,
WEEK(CalDate1) as WeekName,
DATE(MonthStart(CalDate1),'MMM-YY') as CalYear_Month,
DATE(MonthStart(CalDate1),'MMM-YY') as FYear_Month,
DATE(MONTHEND(CalDate1), 'MMM') as CalMonthName, // Standard Calendar Month Name
DUAL('Q' & CEIL(MONTH(CalDate1)/3), CEIL(MONTH(CalDate1)/3)) as CalQuarter, // Standard Calendar Quarter
MOD(Month(CalDate1) - $(vFiscalYearStartMonth), 12)+1 as FiscalMonth,// Fiscal Calendar Month
YEARNAME(DATE(CalDate1), 0, $(vFiscalYearStartMonth)) as FiscalYear;
LOAD
DATE($(vStartDate) + ITERNO() - 1) as CalDate1
AUTOGENERATE (1)
WHILE $(vStartDate) + ITERNO() - 1 <= $(vEndDate);
DROP FIELD CalDate1;
The WeekName field will be your week.
Regards,
Prashant
Hi Prashant,
I have just to cut and paste the script ?
Hi,
Yes, You can do that for testing. but with the real data you have to pass the Min and Max date from you datamodel.
Regards,
Prashant
sorry for my ignorance, but where should I fill in my dates ? i don' understand
In this area of provided script.
LET vStartDate = NUM(Makedate(2018,01,01));
LET vEndDate = NUM(FLOOR(Makedate(2021,07,31)));
ok i filled in as is :
LET vStartDate = NUM(Makedate(2021,01,01));
LET vEndDate = NUM(FLOOR(Makedate(2021,12,31)));
But it doesn't work 😞 (see Screenshot)
Hello, by reading the documentation, I found the solution to my problem, it was necessary to modify the settings of the native calendar in QS (see PJ)