Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
Am finding difficulties while designing rolling months and years please share me if u have any knowledge on this
please dnt share complex querys on that
Thanks
Rajesh
Calculating rolling n-period totals, averages or other aggregations
Set Analysis : Sales
YTD Sales
SUM({$<Date = {">=$(=YearStart(Today())) <= $(=Today())"}>}Sales)
MTD Sales
SUM({$<Date = {">=$(=MonthStart(Today())) <= $(=Today()) "}>}Sales)
Hi,
Try like this
YTD Sales:
SUM({<DateDimensionName = {'>=$(=YearStart(Today())) <= $(=Today())'}>} MeasureName)
MTD Sales:
SUM({$<DateDimensionName = {'>=$(=MonthStart(Today())) <= $(=Today())}>}MeasureName)
Replace your Date dimension and Measure name in above expressions, if expressions are not working then check the format Today() and DateDimensionName are in the same format, if not then convert to the same format.
Regards,
Jagan.
Write like
For YTD Calculation
=SUM({$<DateField = {'>=$(=YearStart(Today()))<=$(=(Today()))'}>} Sales)
For MTD Calculation
=SUM({$<DateField = {'>=$(=MonthStart(Today()))<=$(=(Today()))'}>}Sales)
sum({$<year={"$(=Max(Year))"},Month={"<=$(=Max(Month))"}>}Amount)
sum({$<year={"$(=Max(Year))"},Month={"$(=Max(Month))"}>}Amount)
hi Jagan,
Thanks for sharing that but is that expression gives the last three rolling month sale???
if i want last three months like march,feb,jan i want sum of sales in these months what is the expression??
Hi Rajesh,
Try like this
YTD Sales:
=SUM({<Year=, Month=, DateDimensionName = {'>=$(=YearStart(Today())) <= $(=MonthEnd(Today(), -1))'}>} Sales)
This expression will give the sum of Sales for Jan-14, Feb-14 and Mar-14.
Regards,
Jagan.
Thank u