Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
For this calculation, I need the data from the current month's first day to current day, plus the data from last year of the same month and day until the end of the month. It cannot be static, meaning when the current date changes, so must the aggregation of the data sets.
For example, (December 1, 2017 - December 13, 2017) + (December 13, 2016 - December 31, 2016)
And in a week (December 1, 2017 - December 20, 2017) + (December 20, 2016 + December 31, 2016)
I currently have two variables to represent the two sets of criteria
vTRIRCurrentMonth: '>=$(monthstart(dte))<=$(vToday())'
vTRIRMonthLY: '>=$(vPreviousYearMonth=Today())<=$(vPreviousYearMonth=MonthEnd)'
I am not getting results when I combine in the expression for the chart.
May be this?
And For Month
Sum({<DateFields= {">=$(=Date(MonthStart(Today()))) <=$(=Date(WeekEnd(Today())))"}>} Sales) + Sum({<DateFields= {">=$(=Date(AddYears(Today(),-1))) <=$(=Date(AddYears(MonthEnd(Today()),-1)))"}>} Sales)
And For week
Sum({<DateFields= {">=$(=Date(MonthStart(Today()))) <=$(=Date(Today()))"}>} Sales) + Sum({<DateFields= {">=$(=Date(AddYears(WeekEnd(Today()),-1))) <=$(=Date(AddYears(MonthEnd(Today()),-1)))"}>} Sales)