Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sergi_arbos
Partner - Contributor III
Partner - Contributor III

rank with variables in qliksense doesn't seem to work

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?

1 Solution

Accepted Solutions
marcus_sommer

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

View solution in original post

1 Reply
marcus_sommer

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