Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Promedio movil, 12 semanas anteriores al primer valor presentado en la grafica

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.

4 Replies
MVP & Luminary
MVP & Luminary

Promedio movil, 12 semanas anteriores al primer valor presentado en la grafica

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.

Not applicable

Promedio movil, 12 semanas anteriores al primer valor presentado en la grafica

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

MVP & Luminary
MVP & Luminary

Promedio movil, 12 semanas anteriores al primer valor presentado en la grafica

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.

Not applicable

Re: Promedio movil, 12 semanas anteriores al primer valor presentado en la grafica

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