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.

Examples:<br />

script. N must be (1), 2, (3), 4 or 6. Shift is an integer, where the value 0 indicates the period which<br />

contains date. Negative values in shift indicate preceding periods and positive values indicate succeeding<br />

periods. If you want to align with (fiscal) years not starting in January, indicate a value<br />

between 2 and 12 in first_month_of_year.<br />

monthsstart ( 4, '2001-10-19' ) returns '2001-09-01' with an underlying numeric value<br />

corresponding to '2001-09-01 00:00:00.000'<br />

monthsstart ( 4, '2001-10-19', -1 ) returns '2001-05-01' with an underlying numeric<br />

value corresponding to '2001-05-01 00:00:00.000'<br />

monthsstart ( 4, '2001-10-19', 0, 2 ) returns '2001-10-01' with an underlying<br />

numeric value corresponding to '2001-10-01 00:00:00.000'<br />

MonthsEnd(n, date [, shift = 0 [, first_month_of_year = 1]])<br />

Examples:<br />

Returns a value corresponding to a timestamp with the last millisecond of the n month period (starting<br />

from January 1st) containing date. The default output format will be the DateFormat set in the<br />

script. N must be (1), 2, (3), 4 or 6. Shift is an integer, where the value 0 indicates the period which<br />

contains date. Negative values in shift indicate preceding periods and positive values indicate succeeding<br />

periods. If you want to align with (fiscal) years not starting in January, indicate a value<br />

between 2 and 12 in first_month_of_year.<br />

monthsend ( 4, '2001-07-19' ) returns '2001-08-31' with an underlying numeric value corresponding<br />

to '2001-08-31 23:59:59.999'<br />

monthsend ( 4, '2001-10-19', -1 ) returns '2001-08-31' with an underlying numeric<br />

value corresponding to '2001-08-31 23:59:59.999'<br />

monthsend ( 4, '2001-10-19', 0, 2 ) returns '2002-01-31' with an underlying numeric<br />

value corresponding to '2002-01-31 23:59:59.999'<br />

MonthsName(n, date [, shift = 0 [, first_month_of_year = 1]])<br />

Returns a display value showing the months of the period (formatted according to the MonthNames script<br />

variable) and year with an underlying numeric value corresponding to a timestamp with the first millisecond<br />

of the n month period (starting from January 1st) containing date. N must be (1), 2, (3), 4 or 6. Shift is an<br />

integer, where the value 0 indicates the period which contains date. Negative values in shift indicate preceding<br />

periods and positive values indicate succeeding periods. If you want to align with (fiscal) years not<br />

starting in January, indicate a value between 2 and 12 in first_month_of_year.<br />

Examples:<br />

monthsname ( 4, '2001-10-19' ) returns 'Sep-Dec 2001' with an underlying numeric value<br />

corresponding to '2001-09-01 00:00:00.000'<br />

monthsname ( 4, '2001-10-19', -1 ) returns 'May-Aug 2001' with an underlying numeric<br />

value corresponding to '2001-05-01 00:00:00.000'<br />

monthsname ( 4, '2001-10-19', 0, 2 ) returns 'Oct-Jan 2002' with an underlying<br />

numeric value corresponding to '2001-10-01 00:00:00.000'<br />

WeekStart(date [, shift = 0 [,weekoffset = 0]])<br />

Returns a value corresponding to a timestamp with the first millisecond of the first date ( Monday ) of<br />

the calendar week containing date. The default output format will be the DateFormat set in the script.<br />

Shift is an integer, where the value 0 indicates the week which contains date. Negative values in<br />

shift indicate preceding weeks and positive values indicate succeeding weeks. If you want to work<br />

with weeks not starting midnight between Sunday and Monday, indicate an offset in days in weekoffset.<br />

This may be given as a real number indicating days and/or fractions of a day.<br />

349

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

Saved successfully!

Ooh no, something went wrong!