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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error "in expression:')' expected"

Buen día.

Estoy tratando de correr un script para excluir de una tabla los valores que sean igual a cero, y así, poder crear un gráfico de promedios en el que los valores igual a cero no se tengan en cuenta. Estoy utilizando el siguiente código:

D_consolidacion_tra:

LOAD Año,

     Departamento,

     Capital,

     PIB,

     [PIB per cápita],

     Inflación,

     Count(DISTINCT Departamento)-Count(DISTINCT (Inflación=0>Departamento)) as N,

     [Tasa de desempleo],

     [Ingresos totales],

     [Ingresos de capital],

     [Gastos de capital]

FROM

[..\Qvd\D_2000_ext.qvd]

(qvd);

Pero cuando cargo este proceso, me aparece el error "Error in expression:')' expected".

Agradezco mucho a quien me pueda informar qué significa y cómo puedo solucionarlo. Quedo muy atento.

Jairo Medina.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

if you want to exclude 0 values from an average try to use set analysis in your chart

something like (adapt to your req)

avg({$ <expr={">0"}>} expr)

View solution in original post

10 Replies
Not applicable
Author

He tratado también con el código

Count(DISTINCT Departamento)-Count(DISTINCT $<Inflación=0>Departamento) as N,

y con el código

Count(DISTINCT Departamento)-Count(DISTINCT {$<Inflación={0}>}Departamento) as N,

pero ninguno funciona. Les agradezco mucho.

Not applicable
Author

Thanks, but the problem continue. I'm going to trying to tell you my situation in English:

I'm Trying to load a script to exclude from a table all values that be equal to zero. I want this to make a graph with average without zero values. I have tried with this codes:

1) Count(DISTINCT Departamento)-Count(DISTINCT (Inflación=0>Departamento)) as N,


2) Count(DISTINCT Departamento)-Count(DISTINCT $<Inflación=0>Departamento) as N,


3) Count(DISTINCT Departamento)-Count(DISTINCT {$<Inflación={0}>}Departamento) as N,


First and second code show "Error in expression:')' expected", and the third code doesn´t enable the function as.


Thank you and excuse my English.


Regards,


Jairo Medina.


joggiek
Partner - Contributor III
Partner - Contributor III

Try this:

Count(DISTINCT Departamento)-Count(DISTINCT if(Inflación=>0,Departamento)) as N,

Not applicable
Author

No, the error continues. And when I change the order of signs '>=', it shows this error:

Invalid expression

D_consolidacion_tra:

LOAD Año,

     Departamento,

     Capital,

     PIB,

     [PIB per cápita],

     Inflación,

     Count(DISTINCT Departamento)-Count(DISTINCT if(Inflación>=0,Departamento)) as N,

     [Tasa de desempleo],

     [Ingresos totales],

     [Ingresos de capital],

     [Gastos de capital]

FROM

[..\Qvd\D_2000_ext.qvd]

(qvd)

Thanks!

joggiek
Partner - Contributor III
Partner - Contributor III

Do you need to exclude all data where Inflacion = 0

Not applicable
Author

Exists a code, to write in the chart to edit expression, that allows exclude some values (zero, in my case) to get the average per year?

Thanks, Jairo Medina.

Not applicable
Author

Yes. I need to exclude this data!

joggiek
Partner - Contributor III
Partner - Contributor III

Try this in the load script, or attach some sample data if you can.

FROM

[..\Qvd\D_2000_ext.qvd]

(qvd)

where (Inflacion) = 0;

Or


FROM

[..\Qvd\D_2000_ext.qvd]

(qvd)

where not exists (Inflacion);

maxgro
MVP
MVP

if you want to exclude 0 values from an average try to use set analysis in your chart

something like (adapt to your req)

avg({$ <expr={">0"}>} expr)