Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
siri_v
Contributor II
Contributor II

Set Analysis YeartoDate question

Hello, all,

I have this YTD calculation for metric Sum({$<FiscalYear={$(=Max(Year(Saledate)))}>}Sales)

This works great for current month.. But it does not work when I select Calendar filter (To and From dates) to Feb.. It gives MTD number..  Instead I would need from year beginning till max month selected..  

I have declared in load editor Num(Month(SalesDate)) as MonthNum,

I also tried giving this YTD calc : 

Sum({<FiscalYear={$(=Max(Year(Salesdate)))},MonthNum={"<=$(max(MonthNum)+1)"}>}Sales) but this does not work..

Can someone help me how to proceed. 

Labels (4)
1 Solution

Accepted Solutions
Quy_Nguyen
Specialist
Specialist

Hi,

Try this one: Sum({<SalesDate ={">=$(=YearStart(Max(SalesDate)))<=$(=Date(Max(SalesDate)))"}>}Sales)

It will return YTD Sales of the max Sales Date 

View solution in original post

2 Replies
Quy_Nguyen
Specialist
Specialist

Hi,

Try this one: Sum({<SalesDate ={">=$(=YearStart(Max(SalesDate)))<=$(=Date(Max(SalesDate)))"}>}Sales)

It will return YTD Sales of the max Sales Date 

siri_v
Contributor II
Contributor II
Author

Thank you very much @Quy_Nguyen . This solution worked perfectly!