cancel
Showing results for 
Search instead for 
Did you mean: 

how to create a year-n variable in BEX

Former Member
0 Kudos

Hi experts,

I need to create 2 variables in bex that :

1- allows to filter the interval of year : [2000...input year]

Example, when lunch the bex query :

input year : 2008

the answer for the data is between 2000 and 2008

2- allows to filter input year-1

I dont want to do this using sap exit.

Thanks for your help

Raed

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Crete one restricted key figure with constant restriction (restrict with year 2000) and create another restricted key figure (restrict the required kf with user entry year variable). Now calculate a key figure with difference of these two RKFs (Hide those two restricted key figures) to get the data fro, 2000 - 2008.

Follow the same process as said above and for the second RKF take offset "-1" and define the calculated KF to the data from 2000 - 2007.

Regards

Prasad

Former Member
0 Kudos

Thanks for your reply,

This is a good and easy way; but i was thinking of doing this by creating directly a variable on the 0FISCYEAR where i identify the interval [2000...input year], by doing a replacement path or something.

Is this possible ??

regards

Former Member
0 Kudos

Hi,

try this:

1 Create an intervall for 0FISCYEAR: "From value" 2000

"To value" -> use an variable based on 0FISCYEAR

=> so u have a defined start year and a variable end year

Regards

Tobias

Edited by: Tobias on May 19, 2008 3:48 PM

Former Member
0 Kudos

Hi,

It may not be possible.

No problem to get data from 2000 - 2008.

But we will face problem to get data fro, 2000 - 2007, because if u define offset on variable with range of values system will consider which value (is it from value or two value).

So i thinks it may not be possible to define offset on variable with range of values.

Regards

Prasad

Former Member
0 Kudos

Hi,

it is possible to set an offset for the variable defining the end point for this intervall i described

Regards

Former Member
0 Kudos

Hi Tobias,

I think its no possible, no where we have option to define offset on the end value of variable.

Regards

Prasad

Former Member
0 Kudos

Hi,

Thanks for all your answers, my problem is resolved. it is possible to define an offset on the end value when filtering directly in the selection area, so i have to do this for every selection i have in the query, but i couldnt find a way to create a resusable variable on 0FISCYEAR.

this solution is ok for me for now.

Thanks for your help.

Points rewarded

regards

Raed

Former Member
0 Kudos

Hi Prasad,

u are right u cant define an end value for a variable itself, but what i8 said is to define a variable for the end value, where u can define an offset for this end variable.

e.g. The intervall looks like "2000 - variable (based on 0FISCYEAR)" for this variable u can define an offset.

Cheers

Answers (0)