Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

understanding the 'better calendar script'

Hi

Reference the very good blog post here:

http://qlikviewcookbook.com/2015/05/better-calendar-scripts/

I was testing the initial part of the load and getting a result I dont understand.

This is what I am loading:

LOAD

     min(fieldvalue('Order Header Invoice Date',recno()))-1    as mindate

    ,max(fieldvalue('Order Header Invoice Date',recno()))     as maxdate

AUTOGENERATE

    fieldvaluecount('Order Header Invoice Date')

;

Of the 591 distinct dates in the 'Order Header Invoice Date' it returns mindate as one less than the first date in the 'Order Header Invoice Date' which is correct; however the maxdate value is simply '?'

Is this monday morning stupidity (again) or has something gone wrong or been lost in translation

Thanks

Oli

1 Solution

Accepted Solutions

Re: understanding the 'better calendar script'

try to apply Num or Date function

num(min(fieldvalue('Order Header Invoice Date',recno()))-1)    as mindate

,num(max(fieldvalue('Order Header Invoice Date',recno())))     as maxdate

3 Replies

Re: understanding the 'better calendar script'

try to apply Num or Date function

num(min(fieldvalue('Order Header Invoice Date',recno()))-1)    as mindate

,num(max(fieldvalue('Order Header Invoice Date',recno())))     as maxdate

Re: understanding the 'better calendar script'

It's not a monday morning stupidity. It's something can happen with formatted dates. You could try adding a num around it:   ,num(max(fieldvalue('Order Header Invoice Date',recno())))     as maxdate


talk is cheap, supply exceeds demand
Not applicable

Re: understanding the 'better calendar script'

Thank you both of you.  I have just started to become smarter to the date related 'gotchas'.  I can now add this one to that list.

apologies gwassenaar that I cant mark more than one correct answer and as kush141087 piped you to post I have marked your anwser as helpful.  Cheers anyway

Community Browser