Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

michielvandegoo
Valued Contributor

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.

Tags (1)
1 Solution

Accepted Solutions
gardenierbi
Contributor

Re: QlikView components calenderextfields error

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.

4 Replies
gardenierbi
Contributor

Re: QlikView components calenderextfields error

What do you see in the logfile of the document?

gardenierbi
Contributor

Re: QlikView components calenderextfields error

It's working in the test QVW  :

2016-03-08_1407.png

michielvandegoo
Valued Contributor

Re: QlikView components calenderextfields error

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
Contributor

Re: QlikView components calenderextfields error

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.

Community Browser