Skip to Content

Calculation View Loop

Hi all,

I'm new in HANA Studio, so it might be an easy question but I didn't found a way to get through it.

I have the following Calculation View #1:

  • Key | Seq Num | Value
  • A | 1 | 100
  • A | 6 | 150
  • A | 7 | 150
  • B | 1 | 100
  • B | 2 | 100
  • B | 3 | 150
  • B | 5 | 150

Now I want to have a Calculation View #2 with a new calculated column.

This column will be the "Value" - SUM of all calculated values from the previous "Seq Num".

  • Key | Seq Num | Value | Calc
  • A | 1 | 100 | 100
  • A | 6 | 150 | 50
  • A | 7 | 150 | 0
  • B | 1 | 100 | 100
  • B | 2 | 100 | 0
  • B | 3 | 150 | 50
  • B | 5 | 150 | 0

For instance, the last row would be calculated as: 150 - 50 - 0 - 100 = 0

Note: The "Seq Num" can have gaps.

Is this possible?

Thanks,

Luis

Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.