Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
solverproblems
Contributor
Contributor

Syntax query in Data Loader Script

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.

Labels (1)
1 Solution

Accepted Solutions
ToniKautto
Employee
Employee

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;

 

View solution in original post

2 Replies
ToniKautto
Employee
Employee

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;

 

solverproblems
Contributor
Contributor
Author

Thanks!