Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

New Contributor II

YTD and MTD

Can anyone explain me How does Year to date(YTD) and Month to Date(MTD) works?

1 Solution

Accepted Solutions
MVP

Re: YTD and MTD

Hi,

There are many post related to the YTD and MTD

YTD :- this stands for Year to date means any metric value from Start of year and till date means today date and with help of SET expression we find

=Sum({\$<Date = {'>\$(=Max((YearStart(Date)))) <=\$(=Max(Today()))'}>} Metrics )

MTD:- This stands for Month to date means Start of month which is current month to till date today date.

=Sum({\$<Date = {'>=\$(=Max((MonthStart(Date)))) <=\$(=Max(Datefield))'}>} Metrics)

Regards

Anand

4 Replies
Employee

MVP

Re: YTD and MTD

Generlly you start from a date on which you build a master calendar (look in the community, you will find several examples)

The calendar contains even week, month and year fields, I prefer to work with 201409 as month field or 201427 as week field because sorting and selection is easier.

If you need YTD just write in your expression a condition myDateField <= today() even with set analysis or not.

MVP

Re: YTD and MTD

Hi,

There are many post related to the YTD and MTD

YTD :- this stands for Year to date means any metric value from Start of year and till date means today date and with help of SET expression we find

=Sum({\$<Date = {'>\$(=Max((YearStart(Date)))) <=\$(=Max(Today()))'}>} Metrics )

MTD:- This stands for Month to date means Start of month which is current month to till date today date.

=Sum({\$<Date = {'>=\$(=Max((MonthStart(Date)))) <=\$(=Max(Datefield))'}>} Metrics)

Regards

Anand

Employee