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

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

YTD-MTD

hi all

how to write YTD MTD in single experssion?

2 Replies
JustinDallas
Specialist III
Specialist III

Can you give us some more background on the issue?  Generally, YTD and MTD are found in the 'Calendar' portions of your data model.  And to accomplish that, I have something like this.

LET vToday = today();

Calendar:

Load

  ...

InWeek(TempDate, '$(vToday)', 0) * -1 AS CalCurrentWeek,

InMonth(TempDate, '$(vToday)', 0) * -1 AS CalCurrentMonth,

InYear(TempDate, '$(vToday)', 0) * -1 AS CalCurrentYear,

YeartoDate(TempDate)*-1 as CurYTDFlag, 

....

beck_bakytbek
Master
Master

Hi Naveen,

look at this: https://www.youtube.com/watch?v=ZTB9z32kplk

i hope that helps

Beck