Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
_rohitgharat
Creator
Creator

YTD and MTD

Hi Guys,

           I Have a date Key which consist of year and month i.e  201501,201502 and so on. I want to calculate YTD and MTD using this.Can suggest me how is it possible???

Thanks & Regards,

Rohit

1 Reply
maxgro
MVP
MVP

Sorry but

Month-to-date (MTD) is a period starting at the beginning of the current month and ending at the current date

and you don't have the date in the date key field, you only have the month (all the date in the month)

Or I'm missing something?

Anyway, with a date field, d for example (DD/MM/YYYY is the format of the date field)

sum({<d={">=$(=date(monthstart(today()), 'DD/MM/YYYY'))<=$(=date(today(), 'DD/MM/YYYY'))"}>}  v)

for YTD replace monthstart with yearstart