Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Condition 'AND' or field=EMPTY into a set analysis expression

Hi,

in the anlysis expression below I would need to get the sum where HOTEL_EMPRESA is empty .

Something like HOTEL_EMPRESA={''},

or where HOTEL_EMPRESA is different than 'KIP' and 'HPC' and 'HOP'

I tried this but it does not work

-SUM({<HOTEL_EMPRESA-={'KIP','HPC','HOP'},TIPO_EMPRESA={'HOTEL'}>}AA_REAL_PERIODO_EUR)/1000

How to write it?

Thanks.

1 Solution

Accepted Solutions
Not applicable
Author

Try:  HOTEL_EMPRESA -= "=Null()" inside the set analysis.

The - in front of the first equal sign excludes nulls.  If you want to include nulls, remove the minus sign.

John

View solution in original post

4 Replies
jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hola,

tu expresión se ve bien. Lo que puedes hacer para corroborar que si existen datos de tipo 'KIP','HPC','HOP' es crear una tabla simple con la expresión sum(AA_REAL_PERIODO_EUR)/1000 y como dimensión poner HOTEL_EMPRESA. En esta tabla debes de poder ver el desglose de AA_REAL_PERIODO_EUR por HOTEL_EMPRESA y entre los valores de dimensión debes de poder ver KIP, HPC y HOP.

En el caso de los valores en blanco, la sintaxis ={''} debería funcionar. En caso contrario, puede ser que más bien sean valores nulos

también sería útil si pudieras subir un ejemplo,

saludos

Not applicable
Author

Try:  HOTEL_EMPRESA -= "=Null()" inside the set analysis.

The - in front of the first equal sign excludes nulls.  If you want to include nulls, remove the minus sign.

John

Not applicable
Author

Hi,

I think null() is what I need but I think there is a syntax mistake because it gives me error.

-SUM({<HOTEL_EMPRESA-={'KIP','HPC','HOP'},TIPO_EMPRESA={'HOTEL'}>

Thanks

Not applicable
Author

Sorry is my fault, the field 'HOTEL_EMPRESA' belongs to a table where there is no empty cell so is neccessary to make a previous join load to the main table to have empty cells.

Thanks