cancel
Showing results for 
Search instead for 
Did you mean: 

Keyfigure Calculation using Time independent Attribute as keyfigure

0 Kudos

Hi All

We have a requirement to calculate the Cost of goods sold for Consensus Demand Keyfigure.

The COGS-for-Consensus-demand is at WKPRODLOCCUSTCURR.

The cost-per-unit is an attribute as a keyfigure without any Time Level. It is at PRODLOC level.

The formula I have put for COGS-for-Consensus-demand is:

CONSESNSUSDEMANDCOST@WKPRODLOCCUSTCURR = ZCOSTPERUNIT@PRODLOC * CONSENSUSDEMANDQTY@WKPRODLOCCUST.

It has an additional input of ACTUALREV keyfigure which is at WKPRODLOCCUSTCURR.

But this calculation does not give me any results. The keyfigure remains blank. Do I have to use Time dependent attribute as a keyfigure for such calcualtion? According to SAP if the values remain same for a keyfigure for all time periods, it should be defined as a time independent attribute as keyfigure.

Any Ideas how can this work?

Also, I tried to see if the keyfigure calculation for CONSESNSUSDEMANDCOST works otherwise for a simple/common calculation and it does show results.

Thanks in advance 🙂

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Thanks to you all. It worked!

The problem was data inconsistency. I had to delete all data for PRODLOC and load again. I think the inconsistency was because I changed the planning level for the attribute as a keyfigure after loading the data.


Option 1. I created ZCOSTPERUNIT at LOCPROD level and the caluclation for COGS looked as this. There is also an additional input of ACTUALSREV which is at WKPRODLOCCUSTCURR

CONSESNSUSDEMANDCOST@WKPRODLOCCUSTCURR = ZCOSTPERUNIT@PRODLOC * CONSENSUSDEMANDQTY@WKPRODLOCCUST.
This worked perfectly.

2. I changed the base level of ZCOSTPERUNIT to LOCPRODCURR and the formula to

CONSESNSUSDEMANDCOST@WKPRODLOCCUSTCURR = ZCOSTPERUNIT@PRODLOCCURR * CONSENSUSDEMANDQTY@WKPRODLOCCUST.

And removed the additional input.
For this option I had to add CURRID as primary key in LOCPROD MDT. Because the keys for the MDT and the base level for the attribute as a keyfig from that MDT should always match. After the corrections, it worked.

Both options are ok but for option 1 - the formula only works when there is a value in ACTUALSREV keyfig in the same bucket.

Answers (3)

Answers (3)

0 Kudos

Hi Irmhild

Thanks for your response. Yes, there is a calculation at the request level. There is also an exchangerate calculation in place. I am sure its working because I tried another formula without the time independent attribute as a keyfigure and it worked just fine.

Also I deleted the ZCOSTPERUNIT from the master data type LOCATIONPRODUCT and saved it. I maintained it again and saved it again.

But the Keyfigure CONSENSUSDEMANDCOST is still blank in the planning view.

0 Kudos

Hi Lokesh

I have tried both.

1. I created ZCOSTPERUNIT at LOCPROD level and the caluclation for COGS looked as this. There is also an additional input of ACTUALSREV which is at WKPRODLOCCUSTCURR

CONSESNSUSDEMANDCOST@WKPRODLOCCUSTCURR = ZCOSTPERUNIT@PRODLOC * CONSENSUSDEMANDQTY@WKPRODLOCCUST.

2. I changed the base level of ZCOSTPERUNIT to LOCPRODCURR and the formula to

CONSESNSUSDEMANDCOST@WKPRODLOCCUSTCURR = ZCOSTPERUNIT@PRODLOCCURR * CONSENSUSDEMANDQTY@WKPRODLOCCUST.

And removed the additional input.

Both the options did not give any results in the planning area.

Irmi_Kuntze
Advisor
Advisor

I think you need the cost at LOCPRODCURR level, so the correction looks good

Do you have CONSESNSUSDEMANDCOST@REQUEST = SUM( CONSESNSUSDEMANDCOST@WKPRODLOCCUSTCURR) and EXCHANGERATE assigned to the key figure?

Check your input data: Do you have currency conversion factor maintained?

And if you check the master data workbook ZCOSTPERUNIT, is a value maintained? And as you changed the planning level, you need to populate again to the key figure. Try to change the ZCOSTPERUNIT (or delete, save, re-enter, save)

lokesh_reddy4
Active Participant
0 Kudos

HI Poorva,

Please check your input and output planning levels. I don't see currency dimension in your input planning levels.

BR,

Lokesh