cancel
Showing results for 
Search instead for 
Did you mean: 

Pull unique result in RKF

Former Member
0 Kudos

Hi all,

I have a query issue that I've been trying to solve.

I have a large query with many Calculated Key Figures that is sliced by Vendor. Each vendor has a Primary Material (navigational attribute of 0VENDOR) & a Cost (calculated key figure). My problem is, I need to pull the average Cost for all unique vendors with a the same Primary Material.

For example: if there are 10 Vendors with Primary Material X, I need to pull the sum of the Cost for those 10 vendors with Primary Material X. I then need to divide by 10 (vendor count), to get the average.

Can anyone suggest a way of doing this? I have a unique vendor count, but I am having trouble pulling the Primary Material component into an RKF or CKF.

Thanks for your help! Points awarded.

-CLM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Are you familiar with the Virtual KF ? Sounds like you need this concept.

Your second paragraph would be used as a logic in VKF - the average is calculated at runtime then pump into your report.

Jen

Former Member
0 Kudos

I have never used Virtual Key Figures. They are defined in the backend with ABAP code, right? Kind of like a customer exit variable?

Former Member
0 Kudos

Itu2019s BADI, ABAP OO, class interface method.

You get to define an extra infoobject ( average in this case) and include it in your cube beforehand. Next, create a new BADI using definition RSR_OLAP_BADI. Compose your logic in method COMPUTE.

You're right, defined in the back end, but will be executed at BEx runtime.

Edited by: Jen Yakimoto on Feb 19, 2011 11:36 PM

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for your input - we are working with BOBJ Web Intelligence and we were able to solve this issue on the WebI side.

Former Member
0 Kudos

it is very simple solution

since primary material is existing as navigational attribute.

STEP 1: create a formula variable on primary material. say PRIMARY MATERIAL COUNTER.

STEP 2. Create A CKF " TOTAL UNIQUE VENDOR COUNTS" . its definition is as follows

PRIMARY MATERIAL COUNTER * VENDOR COUNTER

STEP 3: Now create A CKF as " TOTAL COST"

PRIMARY MATERIAL COUNTER. * vendor counter * cost .

STEP 4. create final CKF as

" TOTAL COST"/TOTAL UNIQUE VENDOR COUNTS"

kindly revert back for any issues.

NOTE :

PRIMARY MATERIAL COUNTER , VENDOR COUNTER are formula variables.