
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
YTD, FYTD Calculations
Hi
I am learning Qlik Sense and I want to make a date comparison of YTD, MTD, FYTD
can someone please guide me on how to write a set expression step by step and write a code for YTD, FYTD, and MTD till the date selected in the date picker, not today's day
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As below
YTD = sum({<Date={">=$(=Date(YearStart(max(Date)),'YourDateFormat'))<=$(=Date(Max(Date),'YourDateFormat')"}>}Amount)
MTD = sum({<Date={">=$(=Date(MonthStart(max(Date)),'YourDateFormat'))<=$(=Date(Max(Date),'YourDateFormat')"}>}Amount)
FYTD = sum({<Date={">=$(=Date(YearStart(max({1}Date)),'YourDateFormat'))<=$(=Date(Max({1}Date),'YourDateFormat')"}>}Amount)
If a post helps to resolve your issue, please accept it as a Solution.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
so FYTD is fiscal ytd I assumed it was Full Year ToDate;
FYTD = sum({<Date={">=$(=Date(YearStart(max(Date),0,4),'YourDateFormat'))<=$(=Date(Max(Date),'YourDateFormat')"}>}Amount)
The above assumes April as the first month of the fiscal year, you can modify it as needed
refer below on how to generate a fiscal calendar
If a post helps to resolve your issue, please accept it as a Solution.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As below
YTD = sum({<Date={">=$(=Date(YearStart(max(Date)),'YourDateFormat'))<=$(=Date(Max(Date),'YourDateFormat')"}>}Amount)
MTD = sum({<Date={">=$(=Date(MonthStart(max(Date)),'YourDateFormat'))<=$(=Date(Max(Date),'YourDateFormat')"}>}Amount)
FYTD = sum({<Date={">=$(=Date(YearStart(max({1}Date)),'YourDateFormat'))<=$(=Date(Max({1}Date),'YourDateFormat')"}>}Amount)
If a post helps to resolve your issue, please accept it as a Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much for this solution it works fine against YTD, MTD
but I want to understand how the Fiscal year to date is working?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
so FYTD is fiscal ytd I assumed it was Full Year ToDate;
FYTD = sum({<Date={">=$(=Date(YearStart(max(Date),0,4),'YourDateFormat'))<=$(=Date(Max(Date),'YourDateFormat')"}>}Amount)
The above assumes April as the first month of the fiscal year, you can modify it as needed
refer below on how to generate a fiscal calendar
If a post helps to resolve your issue, please accept it as a Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you So much its working fine now


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
happy to help
If a post helps to resolve your issue, please accept it as a Solution.
