Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Please help me!!!!... I whan to optimize my sentences of my script:
VEH_STOCK:
Load Distinct
Clave_CompraDetalle_Kardex_Vehiculo,
If(Sum(Cantidad_Saldo)=0,'Sin Saldo','Con Saldo') as Estado_Saldo
Resident VEH_KARDEX
Group By Clave_CompraDetalle_Kardex_Vehiculo,Fecha_Kardex;
This code has problems of optimization, What can I do to change the script?
VEH_STOCK: load Clave_CompraDetalle_Kardex_Vehiculo, Fecha_Kardex, If(Sum(Cantidad_Saldo)=0,'Sin Saldo','Con Saldo') as Estado_Saldo, Group By Clave_CompraDetalle_Kardex_Vehiculo,Fecha_Kardex; Load Distinct Clave_CompraDetalle_Kardex_Vehiculo, Fecha_Kardex, Cantidad_Saldo Resident VEH_KARDEX Order By Clave_CompraDetalle_Kardex_Vehiculo,Fecha_Kardex;
Have a look at the document
@pradosh_thakur Qlik internally optimize as always using Order By clause. Preferably like
Temp: // Temp table applied descending order with all rows from fields mentioned
Load Clave_CompraDetalle_Kardex_Vehiculo, Fecha_Kardex, Cantidad_Saldo
Resident VEH_KARDEX
Order By Clave_CompraDetalle_Kardex_Vehiculo,Fecha_Kardex;
VEH_STOCK: // This is the final table,
Where It can optimize the way of concepts with aggregate functions
NoConcatenate load Clave_CompraDetalle_Kardex_Vehiculo, Fecha_Kardex, If(Sum(Cantidad_Saldo)=0,'Sin Saldo','Con Saldo') as Estado_Saldo, Group By Clave_CompraDetalle_Kardex_Vehiculo,Fecha_Kardex;