Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problems with Master Calendar

Hi,

I use a Master Calender with 2-hours-intervals. This works fine, but I have a problem, that I can´t solve.

I load the minDate and set the minDate to the Variable varMinDate, but the problem is, the varMinDate is not long enough and gets another value than the minDate is. For example when the minDate is ...,5, there is no problem, but if the minDate is something like

43.270,33333333333600 the varMinDate will be 43270.333333333 :-(. Can anyone help me to get more Information into the variable?

The effect is, that I have a lot of double Intervals

Thanks a lot

Agathe

This is my Code:

Set DecimalSep='.';
MaxMinDate:
load
min(INTERVAL_START) as MinDate,
max(INTERVAL_START) as MaxDate
resident Key;


let varMinDate = Num(peek('MinDate',0,MaxMinDate));//,',','.','#.##0,00');
let varMaxDate = Num(peek('MaxDate',0,MaxMinDate));//,',','.','#.##0,00000000000000');

LET vDays = Num(varMaxDate - varMinDate) ;

drop table MaxMinDate;

Temp_Calendar:
Load
RowNo() as RowNo,
$(varMinDate) + RowNo()/12 AS DateNumber
TimeStamp(Num($(varMinDate) + RowNo()/12)) AS TempDate 
AUTOGENERATE 12* $(vDays);
Set DecimalSep=',';

Calendar:
LOAD  TempDate AS INTERVAL_START,
date(TempDate) as Datum
week(TempDate) As Woche
Year(TempDate) As Jahr
Month(TempDate) As Monat
Day(TempDate) As Tag,
Hour(TempDate) AS Stunde
RESIDENT Temp_Calendar ORDER BY TempDate ASC;

DROP TABLE Temp_Calendar;


0 Replies