Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
CarlosCerezo
Contributor
Contributor

Ayuda con Acumulación en Script

Buenos días!

 

Tengo el siguiente scrip

Final:
load
FechaInventario,
TranscodeNombre,
VendorName,
ProductionFormulaNo,
"Descripción Código",
Empresa,
Cantidad,
RangeSum(Peek('Acumulado'), Cantidad) AS Acumulado
Resident AcumV1;
Drop Table AcumV1;

CarlosCerezo_1-1666281042790.png

pero no es el resultado deseado porque lo que necesito es que cuando sea otro producto se reinicie la acumulación como en el caso de azufre, en cambio sigue acumulando lo del producto anterior.

Por favor si alguien me puede ayudar estaría muy agradecido

 

Labels (2)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Final:
load
InventoryDate,
TranscodeName,
VendorName,
ProductionFormulaNo,
"Description Code",
Company,
Quantity,
if(  "Description Code"<>peek("Description Code"),     Quantity ,Quantity +Peek('Accumulated') ) AS Accumulated
Resident AcumV1

Order by

InventoryDate,
TranscodeName,
VendorName,
ProductionFormulaNo,
"Description Code",
Company

;
Drop Table AccumV1;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

1 Reply
vinieme12
Champion III
Champion III

Final:
load
InventoryDate,
TranscodeName,
VendorName,
ProductionFormulaNo,
"Description Code",
Company,
Quantity,
if(  "Description Code"<>peek("Description Code"),     Quantity ,Quantity +Peek('Accumulated') ) AS Accumulated
Resident AcumV1

Order by

InventoryDate,
TranscodeName,
VendorName,
ProductionFormulaNo,
"Description Code",
Company

;
Drop Table AccumV1;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.