Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have found an issue using the rank function in qliksense... or with the variables.
This two measures work flawlessly:
Sum({<[DESTINATARIO]={'A TERCEROS'},[OPERACION]={'ALQUILERES'},
[NFECHA_OPERACION]={">=$(vNFrom)<=$(vNTo)"}
>}[RENTA_TOTAL])
It works fine to get the sum between to dates vNFrom to vNTo (they are numbers).
Sum({<[NOMBRE_OBRA] =
{"=Rank(
Sum({<[DESTINATARIO]={'A TERCEROS'},[OPERACION]={'ALQUILERES'}
>}[RENTA_TOTAL])
)
<=10"}
>} [RENTA_TOTAL])
This one gets me the top 10 NOMBRE_OBRA by its RENTA_TOTAL, and it's ok.
But, if I add the date set from the firsts expresion
,[NFECHA_OPERACION]={">=$(vNFrom)<=$(vNTo)"}
so, being the new measure:
Sum({<[NOMBRE_OBRA] =
{"=Rank(
Sum({<[DESTINATARIO]={'A TERCEROS'},[OPERACION]={'ALQUILERES'}
,[NFECHA_OPERACION]={">=$(vNFrom)<=$(vNTo)"}
>}[RENTA_TOTAL])
)
<=10"}
>} [RENTA_TOTAL])
It just doesn't work and returns a null on each row.
Any idea about what I'm doing wrong?
The reason why it didn't work is that you use a further set of double-quotes around your variables and the parser couldn't handle it.
Without rebuilding these logic I don't know exactly how to reslve it but I would start by replacing one of the double-quotes pairs through single-quotes or to mask the quotes by doubling them (like ... "">=....) or to replace the quotes with ascii-numbers like chr(39).
- Marcus
The reason why it didn't work is that you use a further set of double-quotes around your variables and the parser couldn't handle it.
Without rebuilding these logic I don't know exactly how to reslve it but I would start by replacing one of the double-quotes pairs through single-quotes or to mask the quotes by doubling them (like ... "">=....) or to replace the quotes with ascii-numbers like chr(39).
- Marcus