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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
suvechha_b
Creator III
Creator III

how to calculate opening stock depending on closing stock?

how to calculate both Opening stock and Closing Stock from one field?

Closing Stock = sum(Closing_stock) of Jul 2013 i.e 10000

Opening Stock = 10000  of Aug 2013

i.e the value I get as Closing Stock of Jul 2013 is same as Opening Stock of Aug 2013

eg,

                                   July 2013    Aug 2013     Sep 2013   Oct2013

Opening Stock                  0             10000              5000     0

Closing Stock                  10000         5000               0         2000

I am calculating Closing Stock as Sum(closing_stock)  . the table has only one value closing_stock , depending on closing_stock I have to calculate Opening Stock.

24 Replies
paulwalker
Creator III
Creator III

your document not open here....

preminqlik
Specialist II
Specialist II

paul can you please post sample data in qvw....

for current month use this expression :

sum({<Date={'$(=Max(Date))'}>}ClosingStock)

always remember that closing stock for MTD and WTD ,today always same ,, because it is a stock in hand at the end of the day (selections)

regards

Premhas

paulwalker
Creator III
Creator III

Hi Prem,

Actually i am using SAP table, MBEWH

in my database separate YEAR and MONTH fields..

Requirement:

Current month opening stock would be TOTAl_STOCK for Max YEAR - MONTH

preminqlik
Specialist II
Specialist II

hi paul,

try below example ...hope this helps you

muvva2029
Contributor
Contributor

Many thanks Michael.!! 

Your sloution is sutted for my requirment.

 

Regards,

Rama.