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: 
Not applicable

we use MTD in script level?

Hi

I am new to qlikview.

Can we use the MTD and YTD in script level.

1 Reply
maxgro
MVP
MVP

there are functions, InYearToDate InMonthToDate you can use to flag your date; the flags can be used in chart for MTD, YTD

from QlikView online help

InMonthToDate (date, basedate , shift)

returns true if date lies inside the part of month containing basedate up until and including the last millisecond of basedate. The month can be offset by shift. Shift is an integer, where the value 0 indicates the month which contains basedate. Negative values in shift indicate preceding months and positive values indicate succeeding months.

Examples:

inmonthtodate ( '2006-01-25', '2006-01-25', 0 ) returns true

inmonthtodate ( '2006-01-25', '2006-01-24', 0 ) returns false

inmonthtodate ( '2006-01-25', '2006-02-28', -1 ) returns true