Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Amigos,
su ayuda necesito realizar un promedio movil , asi si tengo totales de ventas por semana, debo calcular el promedio con el total de las doce semanas anteriores al primero valor seleccionado o presentado en la grafica, al ser dinamico cada valor presentado en la grafica toma como total los valores correspondientes a las 12 semanas anteriores.
Hi,
Try this expression
=Sum({<Date={">=$(=WeekStart(Max(Date), -12))<=Max(Date)"}>} Sales)
This expression calculates the Sum of Sales for current and past 12 weeks.
Regards,
Jagan.
Gracias, pero me devuelve el valor de cada columna, lo que deseo es tener totales para cada semana , los totales son la suma de las 12 semanas anteriores
Hi,
To do this don't use any dimension.
Suppose if you want 5 bars then give 5 individual expressions, one for each bar.
Current Week:
=Sum({<Date={">=$(=WeekStart(Max(Date), -12))<=Max(Date)"}>} Sales)
Current Week - 1:
=Sum({<Date={">=$(=WeekStart(Max(Date), -13))<=WeekEnd(Max(Date), -1)"}>} Sales)
Current Week - 2:
=Sum({<Date={">=$(=WeekStart(Max(Date), -14))<=WeekEnd(Max(Date), -2)"}>} Sales)
'
'
''
'
Like wise you need to create the chart.
Regards,
Jagan.
Hello
an example might be putting a calculated dimension is not recommended but I take several troubles
first -. dates in loading add
load
date,
/ * Add your fields * /
/ * Add these two fields * /
WeekStart (date) as week_begin,
right (0 & day (WeekStart (date)), 2) & "/" & month (WeekStart (date)) as day_week
/ * ... finish your load * /
then add to your graph the calculated dimension
= if (Aggr (rank (day_week) day_week) <= 12, day_week)
Best Regards