Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm starting to use QV and have a problem that I can not solve. See if you can help me out. Thank You.
I created a table box with the following script:
PlanifRecursos:
LOAD * INLINE [
usuarioid, AUX_Coste1, AUX_Coste2
77, "26,44","5,25"
92, "21,60","8,57"
135, "24,56","9,75"
];
right join(PlanifRecursos)
SQL SELECT agno as PR_Año,
PR_Ejercicio as exercise,
"horas_ene" as PR_HorasEnero,
usuarioid
FROM "v_planif_recurso"
WHERE (v_planif_recurso.ejercicio = 2015) AND (v_planif_recurso.agno = 2015);
This way I get the following result:
exercise | Lamb | usuarioid | horas_ene | AUX_Coste1 | AUX_Coste2 |
2015 | 2015 | 77 | 0 | 26,44 | 5,25 |
2015 | 2015 | 135 | 10 | 24,56 | 9,75 |
2015 | 2015 | 92 | 1 | 21,6 | 8,57 |
My problem is I need to include two new columns to the table box with the result of multiplying the value of the "horas_ene" with values "Aux_Coste1" and Aux_Coste2 "fields, and not how.
The result that I would get something like this:
exercise | Lamb | usuarioid | horas_ene | AUX_Coste1 | AUX_Coste2 | Coste1xHorasEne | Coste2xHorasEne |
2015 | 2015 | 77 | 0 | 26,44 | 5,25 | 0 | 0 |
2015 | 2015 | 135 | 10 | 24,56 | 9,75 | 245,6 | 97,5 |
2015 | 2015 | 92 | 1 | 21,6 | 8,57 | 21,6 | 8,57 |
Where:
Coste1xHorasEne = horas_ene * Aux_Coste1
Coste2xHorasEne = horas_ene * Aux_Coste2
I hope you can help me. Thanks in advance.
Translated with Google Translate - Qlik Community Administrative Team
Hola,
Estoy empezando a utilizar QV y tengo un problema que no sé como resolver. A ver si pueden echarme una mano. Gracias.
He creado un Cuadro de Tabla con el siguiente script:
PlanifRecursos:
LOAD * INLINE [
usuarioid, AUX_Coste1, AUX_Coste2
77, "26,44","5,25"
92, "21,60","8,57"
135, "24,56","9,75"
];
right join(PlanifRecursos)
SQL SELECT agno as PR_Año,
ejercicio as PR_Ejercicio,
"horas_ene" as PR_HorasEnero,
usuarioid
FROM "v_planif_recurso"
WHERE (v_planif_recurso.ejercicio=2015) AND (v_planif_recurso.agno=2015);
De esta forma obtengo el siguiente resultado:
ejercicio | agno | usuarioid | horas_ene | AUX_Coste1 | AUX_Coste2 |
2015 | 2015 | 77 | 0 | 26,44 | 5,25 |
2015 | 2015 | 135 | 10 | 24,56 | 9,75 |
2015 | 2015 | 92 | 1 | 21,6 | 8,57 |
Mi problema es que necesitaría incluir dos nuevas columnas al Cuadro de tabla, con el resultado de multiplicar el valor del campo "horas_ene" con los valores de los campos "Aux_Coste1" y Aux_Coste2", y no se como hacerlo.
El resultado que quisiera obtener es algo así:
ejercicio | agno | usuarioid | horas_ene | AUX_Coste1 | AUX_Coste2 | Coste1xHorasEne | Coste2xHorasEne |
2015 | 2015 | 77 | 0 | 26,44 | 5,25 | 0 | 0 |
2015 | 2015 | 135 | 10 | 24,56 | 9,75 | 245,6 | 97,5 |
2015 | 2015 | 92 | 1 | 21,6 | 8,57 | 21,6 | 8,57 |
Donde:
Coste1xHorasEne = horas_ene * Aux_Coste1
Coste2xHorasEne = horas_ene * Aux_Coste2
Espero que me puedan ayudar. Gracias por anticipado.
The easy way out is to do those calculations in chart expression in a straight table. The alternative is to create a new table with a resident load from the result table that is created by the right join.
PlanifRecursosNew:
LOAD *,
horas_ene * Aux_Coste1 as Coste1xHorasEne,
horas_ene * Aux_Coste2 as Coste2xHorasEne
Resident PlanifRecursos;
Drop Table PlanifRecursos;'
Rename Table PlanifRecursosNew to PlanifRecursos;
Thank you very much for your reply, Gysbert.
It worked perfectly. It was what I needed !!
Regards.