Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error Loading Calendar

Hello,

I am trying to load a calendar using script below.  and I get the following error.

Error:

Field not found - <>

LOAD

  FieldValue('Date', RecNo()) as datefield

AutoGenerate FieldValueCount('Date')

Script:

Calendar Routine

SUB CalendarFromField(_field, _calendar, _prefix)

[$(_calendar)]:

// Generate Final Calendar

LOAD

  [$(_field)]

  ,year([$(_field)]) as [$(_prefix)Year]

  ,month([$(_field)]) as [$(_prefix)Month]

  ,day([$(_field)]) as [$(_prefix)Day]

  ,weekday([$(_field)]) as [$(_prefix)Weekday]

  ,'Q'& ceil(Num(month([$(_field)]))/3) as [$(_prefix)Quarter]

;

// Generate range of dates between min and max.

LOAD

  date(DateMin + IterNo()) as [$(_field)] // Link Field

WHILE DateMin + IterNo() <= DateMax

;

// Find min and max of date field values.

LOAD

  min(datefield)-1 as DateMin

  ,max(datefield) as DateMax

;

// Load date field values.

LOAD

  FieldValue('$(_field)', RecNo()) as datefield

AutoGenerate FieldValueCount('$(_field)');

END SUB

DateLink:

LOAD

  N°Ticket

  ,[Inc Date Creation YYYY MM DD] as Date

  ,'openticket' as DateType

Resident OpenTickets;

LOAD

  N°Ticket

  ,IncDateSolving as Date

  ,'closedticket' as DateType

Resident ClosedTickets;

CALL CalendarFromField('Date', 'MasterCalendar', '');

1 Reply
el_aprendiz111
Specialist
Specialist

Hi,

dATES.png