on 2020 Feb 06 12:17 PM
Hi All,
I have one requirement to replicate the MB5B in HANA Studio. I am using MARDH and MATDOC to bring the data
Currently I got in below use case
Opening_Stock(mardh) Stock_Qty(matdoc) date Closing_Stock
100 5 01.02.2019 105
100 -2 02.02.2019 98
100 3 03.02.2019 103
The output I want to bring is as follows:
Opening_Stock(mardh) Stock_Qty(matdoc) date Closing_Stock
100 5 01.02.2019 105
105 -2 02.02.2019 103
103 3 03.02.2019 106
Where Opening_Stock and Closing stock are calculated column.
Can anybody suggest how to loop the model to achieve the above requirement.
Thanks in Advance
Regards,
Juned
Request clarification before answering.
When I understand you correct, you want to reach that the opening stock of a specific date is the closing stock of the day before, right?
Instead of thinking about using a loop you have to think how you can join the data. In that case based on your original result you need to projections and one of that projections needs a calculated column which calculates the "day before" (date minus 1 day). With that information you can join both projections and prepare your result like you want to have it, because you have all the necessary data in "one row".
Depending on your amount of data and performance requirements the usage of calculated columns can be probably a problem. Maybe in that case you have to think about using a Table Function which prepares the data (if necessary with imperative logic like loops and index based cells access).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
9 | |
8 | |
7 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.