Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi! I have been having some trouble with a date range for QlikView. I already have a date range selector that works great, but when it's the time for using setAnalysis and get the same range in the prior year I just can't make it when using the selector.
I mean, this works when I use the list boxes of my mastercalendar but not for my date picker ranges
Anio = Year and PrimaNeta_EQ = Sales
Sum({$<Anio={$(=Anio-1)}>}PrimaNeta_EQ)
I left you here the thing I'm working on, so you can better idea of the problem.
Thanks for reading!
Alejandra, la expresion que puse le faltaban 2 parentesis (No se copio con el formato correcto).
La expresion funciona bien. Ten en cuenta que si estas seleccionando el anio actual, y en el set analysis quieres mostrar para el anio anterior, entonces falta excluir las selecciones para que muestre los datos correctos.
Esta expresion funciona en tu dashboard:
Sum(
{$<Anio=, Date_1=, Date_1={">=$(=Date(AddMonths(Min(Date_1),-12),'DD-MM-YYYY')) <=$(=Date(AddMonths(Max(Date_1),-12),'DD-MM-YYYY'))"}>}
PrimaNeta_EQ)
Carlos M
the expression works in your data model. see below i changed last year expression to yours Sum({$<Anio={$(=Anio-1)}>}PrimaNeta_EQ)
i am not clear on the issue
Hi!
If you use the date pickers for example, from 17/04/2018 to 5/05/2018 it takes the selection of that range, but I also need the same range from last year selection, in other words, the sales from 17/04/2017 to 5/05/2017.
If i use the listboxes to pick full months I have no problem, the problem comes when I select a date range with the selectors.
Hola Alejandra,
Puedes usar el siguiente set analysis. No abri tu archivo, pero por lo que lei, buscas tener la misma expresion del anio actual para el anio anterior basado en tus selecciones, cierto?
Hay distintas formas de obtener el resultado que deseas, una de ellas es la siguiente:
Sum({$<Campo_Fecha={">=$(=AddMonths(Min(Campo_Fecha),-12 <=$(=AddMonths(Max(Campo_Fecha),-12))"}>} PrimaNeta_EQ)
En lugar de usar el campo anio, utiliza tu campo que tenga la fecha completa.
Espero te sirva,
Carlos M
Hola Carlos, ya probé el código que me compartiste, pero no obtuve resultados. La suma me dio 0.
Alejandra, la expresion que puse le faltaban 2 parentesis (No se copio con el formato correcto).
La expresion funciona bien. Ten en cuenta que si estas seleccionando el anio actual, y en el set analysis quieres mostrar para el anio anterior, entonces falta excluir las selecciones para que muestre los datos correctos.
Esta expresion funciona en tu dashboard:
Sum(
{$<Anio=, Date_1=, Date_1={">=$(=Date(AddMonths(Min(Date_1),-12),'DD-MM-YYYY')) <=$(=Date(AddMonths(Max(Date_1),-12),'DD-MM-YYYY'))"}>}
PrimaNeta_EQ)
Carlos M
Ya la probé y funcionó a la perfección, Muchísimas gracias Carlos!