Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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