If you are asking for help with scripting, it would make things easier when you post either the input files, too, or create a script with all data needed in INLINE tables or using AUTOGENERATE etc. So that we can reload the script after modifications.
I am using a BINARY LOAD to load your existing table, then I tried to create the accumulated field like
if(previous(IdTienda) = IdTienda and previous(IdArticulo) = IdArticulo, rangesum(Cantidad,peek(Accum)),Cantidad) as Accum
ORDER BY IdTienda, IdArticulo, Fecha;
Since it seems you want a cummulation per IdTienda and per IdArticulo, both fields should be used to sort your data (and also Fecha to get the stock over time correctly.
If you want to accumulate per IdTienda and per IdArticulo, you also need to check both fields in the calculated field expression for change, then either accumulate using rangesum() or reset with the current Cantidad.