Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sangeess21
Creator
Creator

Help with Addmonths() set analysis

All,

I'm trying to add the Forecast Quantity based on monthly lead time. For example, if an Item has 217 days as order lead time, monthly lead time is 7 and I add the Forecast quantities of the first seven months. My expression works fine when an item is selected, but it does not work and sums up all 12 months when no selections are made. Any help is greatly appreciated!

Below is my expression:

sum({<Forecast_Date = {">=$(=Date(MonthStart(Today(1)))) <$(=Date(addmonths(MonthStart(today(1)),[Monthly Lead Time])))"}>}[Forecast Quantity])

Thanks!

Labels (3)
3 Replies
sunny_talwar

May be you need to do a Max here?

Sum({<Forecast_Date = {">=$(=Date(MonthStart(Today(1)))) <$(=Date(MonthStart(Today(1), Max([Monthly Lead Time]))))"}>} [Forecast Quantity])
sangeess21
Creator
Creator
Author

It's not working. It still summing up the quantities of the 12 months.

sunny_talwar

Would you be able to share a sample where we can see the issue?