Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, im trying to build an expression with a variable but is not working.
The expression is:
=sum({<idFechaReserva={"<=$(=vIdFechaComparativa)"}>}MontoPagado).
The strange thing is that when i try with
=sum({<idFechaReserva={"<=20131010"}>}MontoPagado)
its works, and the variable vIdFechaComparativa is difine like NUM(replace(date(vFechaComparativa,'YYYY-MM-DD'),'-',''))
What im doing wrong?
Thanks,
Try defining vldFechaComparativa as:
NUM(date($(vFechaComparativa),'YYYY-MM-DD'))
or
NUM(date#($(vFechaComparativa),'YYYY-MM-DD'))
And make your expression:
=sum({<idFechaReserva={"<=$(=$(vIdFechaComparativa))"}>}MontoPagado)
Try below as your variable instead.
dual(replace(date(vFechaComparativa,'YYYY-MM-DD'),'-',''),vFechaComparativa)
I believe the replace function defines the result as text so >= would not work in your set analysis.
Try defining vldFechaComparativa as:
NUM(date($(vFechaComparativa),'YYYY-MM-DD'))
or
NUM(date#($(vFechaComparativa),'YYYY-MM-DD'))
And make your expression:
=sum({<idFechaReserva={"<=$(=$(vIdFechaComparativa))"}>}MontoPagado)
Hi.
I guess, it's all about dates.
This expression is strange:
=NUM(replace(date(vFechaComparativa,'YYYY-MM-DD'),'-',''))
First, you change text date format to 'YYYY-MM-DD' then manually remove '-' and get text YYYYMMDD.
After that you use a function that is supposed to change text format (of dual) to numeric. I guess it returns null.
You have to rewrite the expression to use numerical comparison in set analysis:
=sum({<idFechaReserva={"=idFechaReserva<=$(=vIdFechaComparativa)"}>}MontoPagado)
And variable =NUM(date#($(vFechaComparativa),'YYYY-MM-DD') ) assuming that vFechaComparativa contains date as simple text.
Hello Augusto,
Try this:
=sum({<idFechaReserva={"<='$(=Date(vIdFechaComparativa))' "}>}MontoPagado).
I have a similar case and made a simple example with this formula.
sum({<Fecha={'$(=Date(Max(Fecha)))'}>}Venta)
See attached document.
Best regards.
Y como veo que usas expresiones en español va una breve explicación en español... en el set analysis debemos poner entre comillas simples el valor de fecha pues sino no lo reconoce qlikview además de darle formato de fecha sino lo toma como numero y al intentar buscarlo dentro de nuestro campo Fecha se confunde. En el archivo adjunto esta la expresión que use y la deje sin etiqueta para que veas como interpreta el valor dentro del set analysis (Ver el titulo en el la cabecera de la expresión).
Saludos.
Thanks!
The variable definition was correct, but the expression has to be
=sum({<idFechaReserva={"<=$(=$(vIdFechaComparativa))"}>}MontoPagado)