21.01.2013 Views

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

makeweekdate(1999,6) returns 1999-02-08<br />

MakeTime(hh [ , mm [ , ss [ .fff ] ] ] )<br />

Returns a time calculated from the hour hh, the minute mm the second ss with a fraction fff down to a millisecond.<br />

If no minute is stated, 00 is assumed.<br />

If no second is stated, 00 is assumed.<br />

If no fraction of a second is stated, 000 is assumed.<br />

Examples:<br />

maketime( 22 ) returns 22-00-00<br />

maketime( 22, 17 ) returns 22-17-00<br />

maketime( 22, 17, 52 ) returns 22-17-52<br />

AddMonths(startdate, n , [ , mode] )<br />

Returns the date occurring n months after startdate or, if n is negative, the date occurring n months before<br />

startdate.<br />

By specifying a mode (0 if omitted) the date is set to either the unmodified day of the specified month<br />

(mode=0) or the calculated day as derived from the end of the month (mode=1).<br />

Examples:<br />

addmonths ('2003-01-29',3) returns '2003-04-29'<br />

addmonths ('2003-01-29',3,0) returns '2003-04-29'<br />

addmonths ('2003-01-29',3,1) returns '2003-04-28'<br />

addmonths ('2003-01-29',1,0) returns '2003-02-28'<br />

addmonths ('2003-01-29',1,1) returns '2003-02-26'<br />

addmonths ('2003-02-28',1,0) returns '2003-03-28'<br />

addmonths ('2003-02-28',1,1) returns '2003-03-31'<br />

YearToDate(date [ , yearoffset [ , firstmonth [ , todaydate] ] ])<br />

Returns true if a date falls within the year to date, else false. If none of the optional parameters are used, the<br />

year to date means any date within one calender year from January 1 up to and including the date of the last<br />

script execution.<br />

By specifying a yearoffset (0 if omitted), the function can be transposed to return true for the same period in<br />

another year. A negative yearoffset indicate previous years while a positive one indicates coming years. Last<br />

year to date is achieved by specifying yearoffset = -1.<br />

By specifying a firstmonth between 1 and 12 (1 if omitted) the beginning of the year may be moved forward<br />

to the first day of any month. If you e.g. want to work with a fiscal year beginning on May 1, specify firstmonth<br />

= 5.<br />

By specifying a todaydate (timestamp of the last script execution if omitted) it is possible to move the day<br />

used as the upper boundary of the period.<br />

Examples:<br />

Assume last reload time = 1999-11-18<br />

yeartodate( '1998-11-18') returns false<br />

yeartodate( '1999-02-01') returns true<br />

yeartodate( '1999-11-18') returns true<br />

yeartodate( '1999-11-19') returns false<br />

yeartodate( '1998-11-18', -1) returns true<br />

yeartodate( '1999-11-18', -1) returns false<br />

341

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!