Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with Sum

I have a problem on my board the operation for sum not working:

Normally I leave QTY and I subtract every operation of movement of the result obtained previously.

Except here the problem is that it  takes me all the time the value of the original stock for the subtraction instead of the result obtained after the movements.

Capture2.jpg

The normal results are  507 - 102 = 405 not 429

If anyone have a solution

16 Replies
krishna20
Specialist II
Specialist II

Hi,

Can you please share sample app. It will helps to sort out the problem.

PrashantSangle

Hi,

As Krishna suggest share your app or share your expression which are using.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hello ,

I have attached a few demo

thanks for the help

PrashantSangle

As per your expression logic data is correct your

Qte_Stock_Inventory is 531 and

Qte_Mvt_Sum is -102

therefore final value is 531-102=429

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

I want expression for calculate:

Qte_Stock_Inventory is 531

1st qte_Mvt is -24

531 - 24 : 507

2nd qte_Mvt is -102

507-102 : 405 not 429

etc....

Kushal_Chawda

this is what you are looking for? see the last column

rubenmarin

Hi, this expression for stock réel:

Sum(Qte_Stock_Inventaire)+ rangesum(above(Qte_Mvt_sum, 0, RowNo()))

returns this:

Not applicable
Author

Hi, the expression working but if i have many "Code_Article" the expression don't calculate for each "Code_Article" and i have this error. :

Capture.JPG

I think is missing a field in expression aggr but where i don't know.

Thanks to the help

rubenmarin

My expression only works in a straight table, in a pivot table expanding one Code_Article will break the logic with above().

You can try if it works using 'TOTAL':

Sum(Qte_Stock_Inventaire)+ rangesum(above(TOTAL Qte_Mvt_sum, 0, RowNo()))

Remember to try expanding only one code_article, preferably in the middle (not the first or the last code_article)