Dear all,
I have write below script it working fine except until week 44. Any reason why?
Please see attached excel file I am using same formula/logic in QlikView but not working.
Anything we can change in QlikView script that will give me correct YearWeek Number.
( FYI:
In Excel file Column A,B is exported from QlikView,
Column C is Formula – which populate correct YearWeek and that I want in QlikView script.
SETDayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
Let vStart_Year=Floor(MakeDate(2015,03,02));
Let vEnd_Year=Floor(MakeDate(2022,02,27));
Temp:
Load
Date(TempDate,'DD/MM/YYYY') as Date,
if(week(TempDate)>9, Year(TempDate)& num(week(TempDate)-9,'00'),
if(year(TempDate)= 2018 or year(TempDate)= 2024, num(year(TempDate)-1,'00') & num(week(TempDate)+44,'00'),
year(TempDate)-1 & num(week(TempDate)+43,'00'))) as Fiscal_Year_week;
Load
$(vStart_Year)+IterNo()-1 as TempDate
AutoGenerate 1
While $(vStart_Year)+IterNo()-1 <= $(vEnd_Year);
EXIT script;