Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i'm new to Qlilview and i'm working on a master calendar script . I want to generate the calender for next year starting from January of each year.
So this is my script :
LET varMinDate = Num(MakeDate(YYYY, 1 ,1));
LET varMaxDate = Num(MakeDate(YYYY,12,31));
//*************** Temporary Calendar ***************
TempCalendar:
LOAD
$(varMinDate)+IterNo()-1 AS Num,
Date($(varMinDate)+IterNo()-1,'DD/MM/YYYY') AS TempDate
AUTOGENERATE 1 WHILE $(varMinDate)+IterNo()-1<= $(varMaxDate);
//*************** Master Calendar ***************
Dim_Date:
NoConcatenate
LOAD
TempDate ,
WeekYear(TempDate) &'/ S'& week(TempDate) AS id_Date,
WeekYear(TempDate) AS Year,
Year(TempDate) &'/ M '& month(TempDate) AS YearMonth,
//day(TempDate) AS Day,
//weekday(TempDate) AS WeekDay,
Week(TempDate) as Week
RESIDENT TempCalendar
ORDER BY TempDate Asc;
DROP Table TempCalendar;
Any suggestions ?
Regards,
Ameni
I changed the lines to :
LET varMinDate =Num(MakeDate(year(AddYears(Today(),-1)), 1 ,1));
LET varMaxDate = Num(MakeDate(year(AddYears(Today(),1)),12,31));
So i got year 2014 , 2015 and 2016
grateful for your help everyone
just change these lines in your script
LET varMinDate = Num(MakeDate(year(AddYears(Today(),1)), 1 ,1));
LET varMaxDate = Num(MakeDate(year(AddYears(Today(),1)),12,31));
Massimo thank you for your reply , the thing is i need it to keep the previous 2 years too.Any ideas ?
Hi,
You can use like this.
LET varMinDate = Date(MakeDate(year(AddYears(Today(),1)), 1 ,1));
LET varMaxDate = Date(MakeDate(year(AddYears(Today(),10)),12,31));
Hi,
If you need previous 2 years.You can try like this.
LET varMinDate = Date(MakeDate(year(AddYears(Today(),0)), 1 ,1));
LET varMaxDate = Date(MakeDate(year(AddYears(Today(),-2)),12,31));
I changed the lines to :
LET varMinDate =Num(MakeDate(year(AddYears(Today(),-1)), 1 ,1));
LET varMaxDate = Num(MakeDate(year(AddYears(Today(),1)),12,31));
So i got year 2014 , 2015 and 2016
grateful for your help everyone