I want to create ytd or mtd on my data I have just the month field name in my data so I want to show data as when I select March in the month then it also sums the previous month's data values. Like January value is 100 Feb value is 150 and the March value is 50 when I select March from mtd then it shows a sum of 300 if I select Feb from the month then it shows 250.
Sample Data Attached in picture
Thanks in Advance
Here we have script to create master calendar basically you need to find min date & max date & generate set of dates for between perid.
This is a simple calendar you can create.
Min(LAST_UPDATED_DATE) as MinDate,
Max(LAST_UPDATED_DATE) as MaxDate
Let vMinDate = Date(Floor(Peek('MinDate')),'YYYY-MM-DD');
Let vMaxDate = Date(Floor(Peek('MaxDate')),'YYYY-MM-DD');
Let vStartDate = Date(AddMonths(MonthStart(Date(Floor(Peek('MaxDate')),'YYYY-MM-DD')),-12),'YYYY-MM-DD');
Let vEndDate = Date(Floor(Peek('MaxDate')),'YYYY-MM-DD');
Drop Table Calendar;