Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
ElenaDominguez
Contributor II
Contributor II

Make a table where the stock accumulate month by month

Hello,

I apologize for my english, i hope you understand.

I have the next problem:

I want to do a table where the stock showing the accumulate quantity month by month,

I have the quantity wich is ussed in each month but i want to accumulate month by month taking the initial stock, i do the next formula Sum({<Fecha = {"<=$(= Max(Date(Fecha)))"} >}Cantidad) but doesn´t work how i want it.

These are the information i have:

Type A

MonthConsumo
JanuaryInitial Stock 10
February5
March5
April10

Tiype B

MonthConsumo
JanuaryInitial Stock de 5
February2
March-2
April5

This is what i want it:

TypeJanFebMarApr
A10152030
B57510

Quiero hacer una tabla donde muestre el stock con que termina cada mes, esta información se tiene que ir acumulando por cada mes que vaya pasando.

Tengo la cantidad que se utilizo en cada mes y esta debe sumarse al saldo inicial de cada mes, hice la siguiente formula en una tabla : Sum({<Fecha = {"<=$(= Max(Date(Fecha)))"} >}Cantidad) pero solo funciona si selecciono una fecha.

La información que tengo es la siguiente:

Tipo A

MesConsumo
EneroSaldo inicial de 10
Febrero5
Marzo5
Abril10

Tipo B

MesConsumo
EneroSaldo inicial de 5
Febrero2
Marzo-2
Abril5

El resultado que quiero hacer es el siguiente:

Tipo EneroFebreroMarzoAbril
A10152030
B57510

Agradezco su ayuda

5 Replies
Anil_Babu_Samineni

Check if that helps?

RangeSum(Before(TOTAL Sum(Consumo),0,ColumnNo()))


Capture.PNG

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
Sergey_Shuklin
Specialist
Specialist

Hello, Elena!

You can solve such tasks (calculating accum values) with RangeSum() function. And additional Above() or Before() function depend of presentation of table. Take a look at the pic and attached file, please.

accum_sum.png

ElenaDominguez
Contributor II
Contributor II
Author

Thank you very much!!! i could solve it!!

ElenaDominguez
Contributor II
Contributor II
Author

Thanks!! Only i just remove the TOTAL statement and it works!

Anil_Babu_Samineni

Great, You may help us to mark Helpful and Correct Answer

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