Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
suvechha_b
Creator III
Creator III

Can anyone help

In my attached model , why the opening stock expression is not working?

the above() functions is not working .

I want the output as this :

                                      July 2013    Aug 2013       Sep 2013            Oct2013

Opening Stock                  0              10000              5000               0

Closing Stock                  10000         5000               0                   2000

1 Reply
tresesco
MVP
MVP

Better you calculate this in the script.

Aggregate the stock monthly and then sort it month wise, then use peek function to formulate the opening stock.

Something Like:

MonthlyStock:

Load

          MonthlyStock,

          Month,

          Peek(MonthlyStock) as OpeningStock;

Load

          Sum(Stock) as MonthlyStock,

          Month

From <> group by Month Order By Month;