2 Replies Latest reply on Oct 19, 2018 8:30 AM by Ankit Bansal

Can this Calc be simplified?

Hi All,

Trying to create a calculated filed filter, for same month in last 3 years; is there a way to simplify it or make it more efficient for performance and second question is how to make it dynamic based on user param selection of n number of months. Thanks

[Selected Month] = datetrunc([Time Interval],TODAY())

or

or

[Selected Month] contains date dimension having 1st date of each month in the date, e.g, 2018-09-01,2018-10-01,2018-11-01,2018-12-03, 2019-01-01 etc

so the above calculation will filter Oct'18, Oct'17 and Oct'16

Thanks

RF

• 1. Re: Can this Calc be simplified?

This might be simpler

month([Selected Month]) = month(datetrunc([Time Interval],TODAY()))

and year([Selected Month]) >= year(Today())-2  /*considering you don't have future data. If you have then add this*/                                                                                          and year([Selected Month]) <= year(Today())

• 2. Re: Can this Calc be simplified?

This will solve dynamic parameter also. In second condition just say

and year([Selected Month]) >= year(Today())-#param for no of years#+1