Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kavitha_qlik
Contributor II
Contributor II

Cumulative Sum of Qty in shortage- URGENT HELP!

All, we have requirement to calculate the shortage of a raw material which is been used across multiple orders.

Quantity has to be deducted from total quantity when the required quantity is posted.

For eg.,

Qlikview current values:

Shortage Qty.png

Expected Values :

Net Required Quanity

Release Materials

Shortage quantity

208.8

104

-104.8

208.8

-104.8

-313.6

208.8

-313.6

-522.4

Appreciate all your inputs on this.

1 Solution

Accepted Solutions
sunny_talwar

Try this

if(column(5) < 0, sum({<IOLOTS = {' ','G','W'}>}IOUB01/1000000) - Rangesum(Above(TOTAL sum(WMUORG/1000000) - sum(WMTRQT/1000000),0,NoOfRows(TOTAL))), 'No short')

View solution in original post

14 Replies
sunny_talwar

May be this

RangeSum(Above([Release Materials] - [Net Required Quantity], 0, RowNo()))

sunny_talwar

or this

RangeSum(Above(TOTAL [Release Materials] - [Net Required Quantity], 0, RowNo(TOTAL)))

kavitha_qlik
Contributor II
Contributor II
Author

Thanks Sunny,  this is the current expression i'm using but no luck, will definitely try your expression and update.

Rangesum(Above(TOTAL column(5),0,NoOfRows(TOTAL)))


column (5) = Released Materials - Net Quantity

sunny_talwar

Would you be able to share your app to check this out?

kavitha_qlik
Contributor II
Contributor II
Author

I have attached the app here.

sunny_talwar

Try this

if(column(5) < 0, sum({<IOLOTS = {' ','G','W'}>}IOUB01/1000000) - Rangesum(Above(TOTAL sum(WMUORG/1000000) - sum(WMTRQT/1000000),0,NoOfRows(TOTAL))), 'No short')

kavitha_qlik
Contributor II
Contributor II
Author

Thats Awesome, Thanks so much Sunny,  it is working..

kavitha_qlik
Contributor II
Contributor II
Author

there is one issue with the other calculation, raw materials should be a cmlation of shortage qty.

Net Required Quanity

Release Materials

Shortage quantity

208.8

104

-104.8

208.8

-104.8

-313.6

208.8

-313.6

-522.4

raw mat.png

sunny_talwar

Not sure I understand the difference between the two images?