Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
olguita2014
Creator
Creator

optimize the script

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?

Labels (1)
2 Replies
pradosh_thakur
Master II
Master II

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

https://community.qlik.com/t5/QlikView-Documents/Optimize-Group-By-Performance/ta-p/1481470/page/2/s...

Learning never stops.
Anil_Babu_Samineni

@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;

 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful