Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can obtain a correct date in my calendar ?

Hi,

How can obtain a correct date in my calendar Date

I have one table with date and I want to build a calendar date with the min and max date from my table1.

Table1:

LOAD
    
Date([Date début],'DD/MM/YYYY') as [Début incident]
FROM $(vDataFile)NML_INC_.txt (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);


CalendarTemp:

LOAD

     
Max([Début incident]) as DateMax,
    
Min([Début incident]) as DateMin
RESIDENT Table1;


LET vMaxDate = FieldValue('DateMax',1);
LET vMinDate = FieldValue('DateMin',1) -1;

LET vYearMax = Year($(vMaxDate));
LET vYearMin = Year ($(vMinDate));

[Calendrier Table1]:
LOAD
     
Date(IterNo() + Date($(vMinDate))) as CalendarDate
AutoGenerate 1 WHILE Date(IterNo() + Date($(vMinDate))) <= Date($(MaxDate));

I receive an error message :

Error in expression:
Date takes 1-2 parameters

[Calendrier Table1]:
LOAD
Date(IterNo() + Date(40707,473252315)) as CalendarDate
AutoGenerate 1 WHILE Date(IterNo() + Date(40707,473252315)) <= Date()


I would like to create the first Calendar with my variable vStartDate, min (
Min({1} CalendarDate)) and Max (Max({1} CalendarDate)). The same for vEndDate.

Can someone helps me ?

Thanks in advance.

3 Replies
Gysbert_Wassenaar

AutoGenerate 1 WHILE Date(IterNo() + Date(40707,473252315)) <= Date()

Typo, your variable is missing a v: <= Date($(vMaxDate));


talk is cheap, supply exceeds demand
Not applicable
Author

Date Range - Calendar Date.png

Thanks Gysbert, I have an other question:

How can I create a date range with my StartDate and my EndDate.

CalendarDate >= StartDate and <= EndDate. And the selection is visualizable in my listbox and in my imput zone. Like this picture.

Date Range - Calendar Date 2.png

Have you got an idéa, please ?

Thanks for your help.

Not applicable
Author

Date Range - Calendar Date 3.png

Document  Properties >> Event trigger (variable).

(Actions) : CalendarDate : ='>='& vStartDate & '<='& vEndDate

Document  Properties >> Event trigger (variable).

(Actions - Set variable) : vStartSate: min(CalendarDate)

(Actions - Set variable) : vEndSate: max(CalendarDate)

Thanks for your help.