Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
danm84306
Contributor III
Contributor III

Sum of Value for Date - 30

Hello,

      I am looking for some Set Analysis help. I need to sum Dimension A only for dates that are the Max Date of Value B - 30 days. Nothing I am finding helps, any ideas?

something like

Sum({<Max(Date_B)-30>} Value_A)

10 Replies
Anil_Babu_Samineni

May be this?

Sum({<Date_B = {"$(=Date(Max(Date_B-30),'DD-MM-YYYY'))>} Value_A)


Or

Sum({<Date_B = {">=$(=Date(Max(Date_B-30),'DD-MM-YYYY'))<=$(=Date(Max(Date_B),'DD-MM-YYYY'))>} Value_A)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
danm84306
Contributor III
Contributor III
Author

Neither works. returns "Error in expression"

danm84306
Contributor III
Contributor III
Author

Error was due to missing " but this still does not solve it question. both expressions do not work.

sunny_talwar

Do you want to sum Value_A where the Date_B >= Max(Date_B) - 30? or just Date_B = Max(Date_B) - 30?

sunny_talwar

Also, what is the format for Date_B field?

danm84306
Contributor III
Contributor III
Author

MM/DD/YYYY

danm84306
Contributor III
Contributor III
Author

Sum Value B for all days that equal Max(Date) - 30

sunny_talwar

Try this

Sum({<Date_B = {"$(=Date(Max(Date_B)-30, 'MM/DD/YYYY'))"}>} Value_A)

danm84306
Contributor III
Contributor III
Author

This worked, thank you!!