Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Stock problem

Hi everyone,

I have some trouble so find out a solution on my problem, so i'll explain it to you and hope someone can help me. 🙂

I am building a QV application to manage my client stock. I have a DB which save all the mouvement for each product.

It's something like that.

Mouvement DateClientProduct referenceNum MouvementFinal Stock
13/05/2011C1PR00191
13/05/2011C1PR00183
14/06/2010C1PR00161
20/12/2008C1PR00122
20/10/2008C1PR00113
29/11/2011C1PR002105
13/01/2011C1PR00271
13/04/2010C1PR00253
26/08/2009C1PR00245
13/03/2009C1PR00234
13/04/2011C1PR003111
29/05/2011C2PR00142
19/02/2011C2PR00133
01/12/2010C2PR00120
06/09/2009C2PR00112

I already find a way to build a chart with the final stock for each client and product for a given date. I am using the FirstSortedValue() on the Num Mvt and my chart use two dimension (Client and Product). This chart well represents my final stock for a given.

What I want do know is a bart chart representing the evolution of my stock during the time.

I know what I must do but I can find a solution of how to do it. For each date of my dimension I need to get the last mouvement before this date for each client-product and then sum the final stock. For example, I must have on my bar of february 2010 the value 9 and for the year 2008 the value 2.

I hope it's enough clear to get the point and show me a way to find out a solution.

Regards,

Guillaume

3 Replies
christophebrault
Specialist
Specialist

Hi,

you can try something like Above(sum(Num Mouvement),1) in your chart to have the last value.

But i don't really understand your data...

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
Not applicable
Author

I'm gonna try that.

About data :

Each line is a mouvement in my stock, a sale or a purchase.

For example, I read the third first line :

    - at the end of the mouvement number 6, client 1 has 1 PR001 product in his stock

    - then he buy two of this product the 13/05/2011. He has then 3 piece of this product in his stock

    - the same day he sales two PR001 product. His final PR001 stock his then 1

Hope it helps to understand better

christophebrault
Specialist
Specialist

Ok i understand.

So you can do sum(Final Stock)-Above(sum(Final Stock),1)

It gives you the number of products of the last mouvement.

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin