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: 
Michiel_QV_Fan
Specialist
Specialist

QlikView components calenderextfields error

Hi, I created this statement which works fine in a regular script but it doesn't work in the QlikView components CalendarExtFields. Please review the red part,

// Sample of adding fields to Calendar

,week(Date) as [$(_fieldPrefix)Week]

,WeekYear(Date) & '-' & week(Date) as [$(_fieldPrefix)Year-Week]

,InMonth(Date, floor(today(0)), 0) as [$(_fieldPrefix)ActualMonth]

I get an Unknown statement error.

1 Solution

Accepted Solutions
gardenierbi
Creator II
Creator II

Michiel, this function uses 4 parameters. The 4th parameter controls the offset for the AddMonths function. Try if your script works if you let the 4th parameter empty.

View solution in original post

4 Replies
gardenierbi
Creator II
Creator II

What do you see in the logfile of the document?

gardenierbi
Creator II
Creator II

It's working in the test QVW  :

2016-03-08_1407.png

Michiel_QV_Fan
Specialist
Specialist
Author

Sander,

I use the calendar from field statement, maybe that's the wrong one for use with extension fields.



Error occurs in a different place apparently.

Error in expression:

AddMonths takes 2-3 parameters

LOAD

    Date as [Werkdag],

    Day(Date) as [ExtFields CalendarDag],

    Weekday(Date) as [ExtFields CalendarWeek-Dag],

    Year(AddMonths(Date,)) as [ExtFields CalendarJaar],

    Month(Date) as [ExtFields CalendarMaand],

    'Q' & Ceil(Month(AddMonths(Date,)) / 3) as [ExtFields CalendarKwartaal],

    num(Date) as [ExtFields Calendar_DateSerial],

    AutoNumber(MonthStart(Date),'[ExtFields Calendar_MonthSerial]') as [ExtFields Calendar_MonthSerial],

    AutoNumber(QuarterStart(Date),'[ExtFields Calendar_QuarterSerial]') as [ExtFields Calendar_QuarterSerial],

    AutoNumber(weekyear(Date) &'|' & week(Date),'[ExtFields Calendar_WeekSerial]') as [ExtFields Calendar_WeekSerial]

  

,week(Date) as [ExtFields CalendarWeek]

,WeekYear(Date) & '-' & week(Date) as [ExtFields CalendarYear-Week]

,InMonth(Date, floor(today(0)), 0) as [ExtFields CalendarActualMonth]

gardenierbi
Creator II
Creator II

Michiel, this function uses 4 parameters. The 4th parameter controls the offset for the AddMonths function. Try if your script works if you let the 4th parameter empty.