Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate MTD/YTD

Dear All,

    Hope so al doing well.

    I need help for MTD/YTD Calculations,but i need to calculate in back end itself.Because i want to reduce the front end expressions

    is ther any way to do it.

Regards,

Santhosh Kumar G

Labels (1)
1 Solution

Accepted Solutions
perumal_41
Partner - Specialist II
Partner - Specialist II

I have attached one file .Please check helpful for MTD/YTD  Calculation

Regards,

Perumal

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Use the below script

Load

If(InYearToDate([Date_Field],today(),0),true(),false()) as YTD,

If(InMonthToDate([Date_Field],today(),0),true(),false()) as MTD

From......

[Date_Field] - Date used in your application.

You can use the YTD or MTD value in Front end like, Sum(SalesAmount*YTD) or Sum(SalesAmount*MTD) which gives you the sum of sales amount for the year till date or month till date respectively...

perumal_41
Partner - Specialist II
Partner - Specialist II

I have attached one file .Please check helpful for MTD/YTD  Calculation

Regards,

Perumal

Not applicable
Author

Thank you Mr.Perumal

Not applicable
Author

Hi perumal ,

plz find below attachment for ytd