cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate using data from other line

binhlht
Participant
0 Kudos

Hi,

I have a requirement, use attribute view to calculate the result base on condition come from another line.

If KSCHL = Y then Result will be set from KBETR. If not, Result will be set by it own KBETR * KBETR from corresponding key pair (MATNR, WERKS). Please see the example.

MATNR | WERK | KSCHL | KBETR | Expected Result

01 | A | X | 10 | 200 x 10

01 | A | Y | 200 | 200

01 | A | Z | 15 | 200 x 15

I thinking about add a hidden column to store the value 200 on other lines then use it to do the multiple, or create a calculation view with parameter to hold the value. However I still not get the right answer for the requirement.

Thanks for your help, very appreciated

Binh

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

How often does the "key pair" for the KSCHL = Y exist? I think only one time, because otherwise it would not be possible to identify that in a unique way. In that case you can join that data in a separate projection node and apply your calculation logic in a calculated column.

Please consider that attribute views are already deprecated already, you should use graphical calc. views only in future.

binhlht
Participant
0 Kudos

Yes, MATNR - WERKS - KSCHL is unique.

I also consider using calculation view, thanks.

Answers (0)