Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
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.

Tags (4)
1 Solution

Accepted Solutions

Re: Calculate StockInHand

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

11 Replies

Re: Calculate StockInHand

Hi Pavan, in StockINH expression you can use:

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

arulsettu
Honored Contributor III

Re: Calculate StockInHand

hi

try this

sum(StockIN)-sum(StockOUT)

Not applicable

Re: Calculate StockInHand

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
Honored Contributor III

Re: Calculate StockInHand

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

Re: Calculate StockInHand

Yes, I know that, please check attachment.

Re: Calculate StockInHand

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

Re: Calculate StockInHand

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.

Re: Calculate StockInHand

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

Re: Calculate StockInHand

Hi Ruben,

Thanks a ton for your shift help.

You really deserve it.

Thank you so much.

Regards,

Pavan.