Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How it would be this query in Qlik Sense syntax in data loader script?
TABLA_UTIL: SQL SELECT "PERIODO", SUM(DEUDAFINAL) as "DEUDAFINAL" FROM "DL_RG_ANALYTICS"."SH_PROVISION" PRO WHERE ORG='628' GROUP BY PERIODO concatenate SQL SELECT OL.PERIODO, SUM(ABIERTA/1000000)+ DEUDA/1000000 FROM "DL_RG_ANALYTICS"."SH_OTRAS_LINEAS" OL LEFT JOIN SH_SALDO_NO_IDEN_RUT PRO ON(OL.PERIODO=PRO.PERIODO) WHERE ((ol.TIPO_DEUDA='TRASPASO' AND ol.DEFINICION='SALDO' ) OR (ol.TIPO_DEUDA='SAE' AND ol.DEFINICION='SALDO' ) OR (ol.TIPO_DEUDA='REPACTACIONES' AND ol.DEFINICION='SALDO') OR (ol.TIPO_DEUDA='RENEGOCIADO' AND ol.DEFINICION='SALDO' ) OR (ol.TIPO_DEUDA='AVANCE_EFECTIVO' AND ol.DEFINICION='SALDO' )) AND PRO.TipoTarjeta='ABIERTA' GROUP BY OL.PERIODO, PRO.DEUDA
Any help is welcome, thanks.
The two queries do not produce a clear relationship, but I assume that the two table are expected to represent the same two columns. Simplest way in Qlik is to simple name the fields the same in both tables, and the QIX engine will automatically concatenate the data. Is this the result you are looking for?
TABLA_UTIL: SQL SELECT "PERIODO", SUM(DEUDAFINAL) as "DEUDAFINAL" FROM "DL_RG_ANALYTICS"."SH_PROVISION" PRO WHERE ORG='628' GROUP BY PERIODO; SQL SELECT OL.PERIODO AS PERIODO, SUM(ABIERTA/1000000)+ DEUDA/1000000 AS "DEUDAFINAL" FROM "DL_RG_ANALYTICS"."SH_OTRAS_LINEAS" OL LEFT JOIN SH_SALDO_NO_IDEN_RUT PRO ON(OL.PERIODO=PRO.PERIODO) WHERE ((ol.TIPO_DEUDA='TRASPASO' AND ol.DEFINICION='SALDO' ) OR (ol.TIPO_DEUDA='SAE' AND ol.DEFINICION='SALDO' ) OR (ol.TIPO_DEUDA='REPACTACIONES' AND ol.DEFINICION='SALDO') OR (ol.TIPO_DEUDA='RENEGOCIADO' AND ol.DEFINICION='SALDO' ) OR (ol.TIPO_DEUDA='AVANCE_EFECTIVO' AND ol.DEFINICION='SALDO' )) AND PRO.TipoTarjeta='ABIERTA' GROUP BY OL.PERIODO, PRO.DEUDA;
The two queries do not produce a clear relationship, but I assume that the two table are expected to represent the same two columns. Simplest way in Qlik is to simple name the fields the same in both tables, and the QIX engine will automatically concatenate the data. Is this the result you are looking for?
TABLA_UTIL: SQL SELECT "PERIODO", SUM(DEUDAFINAL) as "DEUDAFINAL" FROM "DL_RG_ANALYTICS"."SH_PROVISION" PRO WHERE ORG='628' GROUP BY PERIODO; SQL SELECT OL.PERIODO AS PERIODO, SUM(ABIERTA/1000000)+ DEUDA/1000000 AS "DEUDAFINAL" FROM "DL_RG_ANALYTICS"."SH_OTRAS_LINEAS" OL LEFT JOIN SH_SALDO_NO_IDEN_RUT PRO ON(OL.PERIODO=PRO.PERIODO) WHERE ((ol.TIPO_DEUDA='TRASPASO' AND ol.DEFINICION='SALDO' ) OR (ol.TIPO_DEUDA='SAE' AND ol.DEFINICION='SALDO' ) OR (ol.TIPO_DEUDA='REPACTACIONES' AND ol.DEFINICION='SALDO') OR (ol.TIPO_DEUDA='RENEGOCIADO' AND ol.DEFINICION='SALDO' ) OR (ol.TIPO_DEUDA='AVANCE_EFECTIVO' AND ol.DEFINICION='SALDO' )) AND PRO.TipoTarjeta='ABIERTA' GROUP BY OL.PERIODO, PRO.DEUDA;
Thanks!