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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SQL statement in Qlik

Hi,

I need to performe this sql statement in qlik with the load script. I mean I have the tables stores in qvds and i need to get the same result of this sql statement with load in Qlik.

SQL SELECT DISTINCT TRA.Idetra, TRA.FechaTecleo, CLA.Nombre, TRA.ImpTras

        FROM GTR_Traspasos TRA

                LEFT JOIN GTR_Tras_Clasificacion CLA ON TRA.IdClasificacion = CLA.Id

                LEFT JOIN GTR_EstadoFinal ESTFIN ON TRA.IdEstadoFinal = ESTFIN.Id_Estado_Final

                LEFT JOIN GTR_MS_Estados EST ON ESTFIN.IdEstado = EST.IdEstado

                LEFT JOIN GTR_MS_TipInfo TIPINF ON ESTFIN.Id_TipInfo = ESTFIN.Id_TipInfo

        WHERE TRA.FlagEstado <>  0 AND ESTFIN.IdEstado = 1 AND TIPINF.Id_TipInfo = 4

                AND TRA.Fecha_Fichero = (SELECT MAX(TRA2.Fecha_Fichero) FROM GTR_Traspasos TRA2 WHERE TRA.Idetra = TRA2.Idetra)

        ORDER BY CLA.Nombre, TRA.FechaTecleo;

The tables are store in qvds but i don´t know how to structure the load

1 Reply
sunny_talwar

May be like this:

Table:

SQL SELECT DISTINCT TRA.Idetra, TRA.FechaTecleo, CLA.Nombre, TRA.ImpTras

        FROM GTR_Traspasos TRA

                LEFT JOIN GTR_Tras_Clasificacion CLA ON TRA.IdClasificacion = CLA.Id

                LEFT JOIN GTR_EstadoFinal ESTFIN ON TRA.IdEstadoFinal = ESTFIN.Id_Estado_Final

                LEFT JOIN GTR_MS_Estados EST ON ESTFIN.IdEstado = EST.IdEstado

                LEFT JOIN GTR_MS_TipInfo TIPINF ON ESTFIN.Id_TipInfo = ESTFIN.Id_TipInfo

        WHERE TRA.FlagEstado <>  0 AND ESTFIN.IdEstado = 1 AND TIPINF.Id_TipInfo = 4

                AND TRA.Fecha_Fichero = (SELECT MAX(TRA2.Fecha_Fichero) FROM GTR_Traspasos TRA2 WHERE TRA.Idetra = TRA2.Idetra)

        ORDER BY CLA.Nombre, TRA.FechaTecleo;

STORE Table into YourPath\QvdName.qvd (qvd);