Пример кода создания календаря для приложения QlikView 11, 12:
Календарь: пример скрипта (кода) реализации в QlikView 11, 12
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
//Формирование календаря QuartersMap: MAPPING LOAD rowno() as Month, 'Q' & Ceil (rowno()/3) as Quarter AUTOGENERATE (12); Temp: LOAD min([День]) as minDate, max([День]) as maxDate Resident [СвязующаяТаблица]; Let vStartDate = Date(Num(Peek('minDate', 0, 'Temp'))); Let vEndDate = Date(Num(Peek('maxDate', 0, 'Temp'))); Let varMinDate = Num(Peek('minDate', 0, 'Temp')); Let varMaxDate = Num(Peek('maxDate', 0, 'Temp')); DROP Table Temp; TempCalendar: LOAD $(varMinDate) + Iterno()-1 As Num, Date($(varMinDate) + IterNo() - 1) as TempDate AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate); Календарь: Load Date(TempDate) AS День, week(TempDate) As Неделя, Month(TempDate) As Месяц, ApplyMap('QuartersMap', month(TempDate), Null()) as Квартал, Year(TempDate) As Год, Day(TempDate) As НомерДень, Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as НеделяГод, Month(TempDate) & '-' & Year(TempDate) as МесяцГод, ApplyMap('QuartersMap', month(TempDate), Null()) & '-' & Year(TempDate) as КварталГод, WeekDay(TempDate) as ДеньНедели Resident TempCalendar Order By TempDate ASC; Drop Table TempCalendar; |
Ключевые слова: Календарь: пример скрипта (кода) реализации в QlikView 11, 12