cancel
Showing results for 
Search instead for 
Did you mean: 

How to Get Max key figure value

0 Kudos

I created analytic view to join VBAK VBFA and VBRK tables. I am trying to identify last invoice created for Contract in VBAK table. Currently if I have 3 invoices created for contract I get three entries in output when I look at:

VBAK-VBELN VBRK-VBELN

1                              1001

1                               1002

1                               1003

I used Left outer join. What I need is:

VBAK-VBELN VBRK-VBELN

1                               1003

What is the best way to achieve this result?

Thanks,

Nitesh

Accepted Solutions (1)

Accepted Solutions (1)

sagarjoshi
Advisor
Advisor
0 Kudos

One possible way to achieve this would be to create a Graphical Calculation view and use an aggregation node where you derive max(vbeln) and use that in further joins.

Otherwise you can consume this by writing SQL queries on top of your analytic view

0 Kudos

I get following error when I use Max function on key figure column. Do I need to create Calculation view for this?

Could not execute 'SELECT max ("VBELN_1") FROM "_SYS_BIC"."NSHELAR/AN_CONTRACT_EXCH_RATES"' in 176 ms 390 µs .

SAP DBTech JDBC: [2048]: column store error: search table error:  [6900] Error executing physical plan: exception 6900:

AttributeEngine/Parallel/Aggregation.cpp:4436

Attribute engine failed; $function$=createAggregators; $message$=invalid keyfigure REPORTING:VBAPen 0x00007f1247907820

,in executor::Executor in cube: _SYS_BIC:NSHELAR/AN_CONTRACT_EXCH_RATES

sagarjoshi
Advisor
Advisor
0 Kudos

May be you can explain how your model is built. Are you using some attribute views as well?

I have checked for my analytic views and I dont get any such error

0 Kudos

Hi,

My Model is very simple. Its just one Analytic view which has two tables : VBFA and VBRK.

Joined on VBRK-VBELN = VBFA-VBELN.

I am not able to execute Select Max(VBELN) from this analytic view, it gives above error as VBELN is of VARCHAR type.

But I did consumed this in calculation view and ran the Max function and I am getting desired results.

I am in SP 69 release. Not why same function works in Calculation view and doesnt work in Analytic view.

Thanks for your help.

Answers (0)