Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
gautik92
Specialist III
Specialist III

MTD

How to calculate the MTD value

1 Solution

Accepted Solutions
Not applicable

=sum({<Year={$(=Max(Year))},Transactiondate={">=$(=MonthStart(max(Transactiondate)))"}>} Qty)

View solution in original post

15 Replies
ali_hijazi
Partner - Master II
Partner - Master II

can you please explain in english what do you mean by mtd?

I can walk on water when it freezes
gautik92
Specialist III
Specialist III
Author

Month to Date Value Calculation

its_anandrjs

Calculate MTD:

=Sum({<DateField={'>=$(=MonthStart(Today()))<=$(=Today())'}>} Metric)

Ex:-

=Sum({<DateField={'>=$(=MonthStart(Today()))<=$(=Today())'}>} SAles)

gautik92
Specialist III
Specialist III
Author

Actually This s my YTD

=sum({<Year={$(=Max(Year))},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty)

can i modify this for MTD

its_anandrjs

Why not you use another expression and you can try this expression

=Sum({<DateField={'>=$(=MonthStart(Today()))<=$(=Today())'}>} Metric)


Or you can try


=sum({<MonthField = {$(=Max(MonthField))},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty)


Regards

Anand

Not applicable

=sum({<Year={$(=Max(Year))},Transactiondate={">=$(=MonthStart(max(Transactiondate)))"}>} Qty)

PrashantSangle

Hi,

Try like

=sum({<Year={$(=Max(Year))},Transactiondate={"<=$(=max(Transactiondate))>=$(=monthstart(max(Transactiondate)))"}>} Qty)

or

=sum({<Year={$(=Max(Year))},Transactiondate={"<=$(=date(max(Transactiondate)))>=$(=date(monthstart(max(Transactiondate))))"}>} Qty)

or

=sum({<Year={$(=Max(Year))},Transactiondate={"<=$(=timestamp(max(Transactiondate)))>=$(=timestamp(monthstart(max(Transactiondate))))"}>} Qty)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable

hi gowtham,

yes, you can modify your ytd expression to your mtd expression. just replace year with month. i.e.

=sum({<Month={$(=Max(Month))},Year={$(=Max(Year))},Transactiondate={"<=$(=max(Transactiondate))"}>}Qty)

cheers,

kunal bhattacharjee

perumal_41
Partner - Specialist II
Partner - Specialist II


Hi

Try this

=sum({<Year={$(=Max(Year))},Month={'$(=max(Month))'},Transactiondate={"<=$(=max(Transactiondate))"}>} Qty)