Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate StockInHand

Hi,

Can any one please help me, on "how to calculate Stock In Hand".

Below table is from excel.

dateStockINStockOUTStockINHLogicExplanation
01/01/151001585100 - 15 = 85
01/02/1510455085 + 10 - 45 = 50
01/03/151114050 + 1 - 11 = 40
01/04/1525353040 + 25 - 35 = 30
01/05/1520104030 + 20 - 10 = 40

How to get the values in "StockINH" using qlikview.

I'm using personal edition, please tell me the procedure to achieve.

Thanks In Advance.

Regards,

Pavan.

1 Solution

Accepted Solutions
rubenmarin

That's not supposed to be a field name, it's a expression name, if you name your expression "StockINH", it will work. If you named it different you need to set your expression name:

Expression: Alt(Above(TOTAL [ExpressionName]), 0) +StockIN-StockOUT

View solution in original post

11 Replies
rubenmarin

Hi Pavan, in StockINH expression you can use:

Alt(Above(TOTAL [StockINH]), 0) + StockIN - StockOUT

arulsettu
Master III
Master III

hi

try this

sum(StockIN)-sum(StockOUT)

Not applicable
Author

Hi Ruben,

Thanks for your quick response.

Out of 5 columns, only first 3(date, StockIN, StockOUT) are in excel, last 2, I have created for your reference.

I need to achieve StockINH, for that last column is the logic.

Regards,

Pavan.

arulsettu
Master III
Master III

create a straight table and date as dimension use above code in script

rubenmarin

Yes, I know that, please check attachment.

rubenmarin

OK, you have personal edition... what I did:

Script:

LOAD Date(date) as date, StockIN, StockOUT;

LOAD * INLINE [

    date,StockIN,StockOUT

    01/01/15,100,15

    01/02/15,10,45

    01/03/15,1,11

    01/04/15,25,35

    01/05/15,20,10

];

Graph:

Dimensions: date,StockIN,StockOUT

Expression StockINH: Alt(Above(TOTAL [StockINH]), 0) +StockIN-StockOUT

Not applicable
Author

Hi Ruben,

I don't have stockINH column in excel, it is showing error.

Please let me know where I'm doing wrong, please help me out.

Capture.JPG

Regards,

Pavan.

rubenmarin

That's not supposed to be a field name, it's a expression name, if you name your expression "StockINH", it will work. If you named it different you need to set your expression name:

Expression: Alt(Above(TOTAL [ExpressionName]), 0) +StockIN-StockOUT

Not applicable
Author

Hi Ruben,

Thanks a ton for your shift help.

You really deserve it.

Thank you so much.

Regards,

Pavan.