Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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)
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.
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.
Try this:
Count(DISTINCT Departamento)-Count(DISTINCT if(Inflación=>0,Departamento)) as N,
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!
Do you need to exclude all data where Inflacion = 0
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.
Yes. I need to exclude this data!
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);
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)