cancel
Showing results for 
Search instead for 
Did you mean: 

Variable-dependent accumulation

Former Member
0 Kudos

Hi,

I have following problem: There is an InfoCube with stock and sale information for each item and each day. I need a query to show the stock on the selected day and the sales of the last x days. How can I store this variable in the query? How do I define the Query? I tried a restricted key figure with a customer exit but I didn't get the current selected day. And if I change the filter value for the selected day in the BEx-analyzer I didn't catch the customer exit at all.

Does anybody have a suggestion.

Accepted Solutions (0)

Answers (1)

Answers (1)

michael_koch9
Active Participant
0 Kudos

Hi,

your idea with the restricted Key Figures was right,

but you don´t need a customer exit for this, just restrict the key figure to characterstic date (e.g. 0DATE) and assign a variable to this characteristic (if there is no variable you can create easily one via viariable wizard.

The sales of the last x days can be even done by a variable.

Create another restricted key figure with day and set an intvall from your variable to your variable - 6 (this is a example offset which can set by: right click om variable >> set offset.

The Offset calculates in runtime: e.g. variable value is 20.02.2006 then offset -1 is 19.02.2006.

Regards

Marcus

Former Member
0 Kudos

Hi,

thanks for your answer but unfortunately i don't get the result I need.

Here's my problem in detail:

I have a free characteristic for 0calday and I need for each day in the selected range the sales figures of the last 20 days for a forecast.

For testing purposes I created a new variable of the type 'manually input' and a restricted keyvalue with the keyvalue 'sale' and restricted by my new variable and and an interval. This is the result: I manually select the value for the variable and get for all query dates in the intervall defined by the variable-intervall the sale figure of this particular date and for all query dates outside the intervall I get nothing.

So here are my two questions: how do I get the summation and how do I get around the manual input?

Thanks Jürgen

Former Member
0 Kudos

Hi,

I hope,If you use 0calday in the "filter" area and/or at the restriction defination ,other than using aa free characterstic solves the problem.

With rgds,

Anil Kumar Sharma .P

michael_koch9
Active Participant
0 Kudos

Hi Jürgen,

sorry, but just to get you right, do you like to have 20 days sales in separate key figures or a sum?

If you not a like a manual input you can use SAP Content Variable e.g. for Actual Day if there is not the rigth content variable for you, you have to create it in a customer exit.

Regards Marcus

Former Member
0 Kudos

Hi Marcus,

I need it as a separate key figure.

The 20-days interval should be related to the currently processed value of 0calday. How can I access this value in a customer-exit?

thanks

Jürgen

michael_koch9
Active Participant
0 Kudos

Hi,

maybe now i your problem:

you have query were the day is in the rows (which comes from the cube data):

is it that what you like:

day sales 20 days before

20.02 100 1800 ( 19.02 and 19 days before )

19.02 50 1700 ( 18.02 and 19 days before )

.

.

.

Please confirm first if it is this what you want to achive, anf its not explain please with a example.

Regards

Marcus

Former Member
0 Kudos

Hi Marcus,

that's excactly my problem

Jürgen