cancel
Showing results for 
Search instead for 
Did you mean: 

Script: Copy from single member to multiple members with "attribute=X"

Former Member
0 Kudos

Hi,

i've struggled with a simple script all afternoon.

I have some data on a specific time dimension. TIME=SALARY.

I want to copy this "set of data" out to all time dimensions which has the attribute "BUDGET=X".

So my challenge is to isolate a specific time im my member set and copy it to multiple members..

My old script is manually maintained.

XDIM_MEMBERSET  TIME = "SALARY"

*REC(EXPRESSION = %VALUE%, TIME=2012.01)

*REC(EXPRESSION = %VALUE%, TIME=2012.02)

ETC.

Now I instead want something like:

XDIM_MEMBERSET  TIME = "SALARY"

*REC(EXPRESSION = %VALUE%, "ALL PERIODS WITH ATTRIBUTE BUDGET=X").

So instead of having to change my script from time to time - I can just change my masterdata.

Any suggestions or solutions ? 🙂

Regards

jdalby

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Is SALARY a member of the TIME dimension?

Try using the below script:

*XDIM_MEMBERSET  TIME = SALARY

*SELECT(%MY_PERIODS%, "[ID]", TIME, "[BUDGET] = 'X'")

*WHEN TIME

*IS *

   *FOR %VAR% = %MY_PERIODS%

      *REC(EXPRESSION = %VALUE%, TIME=%VAR%)

   *NEXT

*ENDWHEN

Or

*SELECT(%MY_PERIODS%, "[ID]", TIME, "[BUDGET] = 'X'")

*XDIM_MEMBERSET  TIME = %MY_PERIODS%

*WHEN TIME

*IS *

   *REC(EXPRESSION = [TIME].[SALARY])

*ENDWHEN

Hope this helps.

Former Member
0 Kudos

Hello,

unfortunately, it doesn't work the way I want it to work. 🙂

I load data to "generic" dimensions values.

So I load to Category = SALARY and TIME = Salary.

I want to copy these loaded data to ALL the TIME and CATEGORY dimensions, which have the value "X" on a attribute (ACTIVE_BUDGET).

So if want to Filter out my loaded data:

*XDIM_MEMBERSET TIME = SALARY

*XDIM_MEMBERSET  CATEGORY = SALARY

and copy the data to

TIME.ACTIVE_BUDGET =X

CATEGORY.ACTIVE_BUDGET =X

Hope this explain my problem. 🙂

regards

Joergen

former_member186338
Active Contributor
0 Kudos

Do you really have time period SALARY in the Time dimension?

Vadim

Former Member
0 Kudos

Solved it..

A little workaround. On "category" I added a attribute, which Category I want to copy to:

*SELECT(%MY_PERIODS%, "[ID]", TIME, "[COPY_TO] = "X")
*XDIM_MEMBERSET TIME = TIME_SALARY
*XDIM_MEMBERSET CATEGORY = "CATEGORY_SALARY"


*WHEN TIME
*IS *
*FOR %VAR% = %MY_PERIODS%
*REC(EXPRESSION = %VALUE%, TIME = %VAR%, CATEGORY=CATEGORY.CAT_COPY_TO)
*NEXT
*ENDWHEN

regards

jdalby

former_member186498
Active Contributor
0 Kudos

Hi Joergen,

try this

*SELECT(%MY_PERIODS%, "[ID]", TIME, "[BUDGET] = 'X'")
*SELECT(%MY_CATS%, "[ID]", CATEGORY, "[BUDGET] = 'X'")

*WHEN TIME
*IS SALARY
  *WHEN CATEGORY
  *IS SALARY
    *FOR %MY_PER% = %MY_PERIODS%
      *FOR %MY_CAT% = %MY_CATS%
        *REC(EXPRESSION = %VALUE%, TIME=%VAR%, CATEGORY=%MY_CAT%)
      *NEXT
    *NEXT
  *ENDWHEN
*ENDWHEN
*COMMIT

Kind regards

     Roberto

Former Member
0 Kudos

Hi Vadim Kalinin,

from a traditional SAP BW perspective, I would agree on your comment..

But given that SAP BPC is a flexible and more "out-of-the-box" system, I see no reason why not to bend the traditional rules.

Having said that, I of course would like to know - why this possibly could represent an issue ?

Thank you,

jdalby

Former Member
0 Kudos

Roberto,

thank you. Spot on.. Your suggestion worked !! 🙂

final script:

*SELECT(%MY_PERIODS%, [ID], TIME, [COPY_TO] = "X")
*SELECT(%MY_CATS%, [ID], CATEGORY, [ACT_BUD] = "X")

*WHEN TIME
*IS TIME_SALARY
*WHEN CATEGORY
  *IS CATEGORY_SALARY
  *FOR %PERIODS% = %MY_PERIODS%
   *FOR %CATEGORIES% = %MY_CATS%
    *REC(EXPRESSION = %VALUE%, TIME = %PERIODS%, CATEGORY = %CATEGORIES%)
   *NEXT
  *NEXT
*ENDWHEN
*ENDWHEN
*COMMIT

regards

jdalby

former_member186338
Active Contributor
0 Kudos

Well, base members of TIME dimension correspond to specific time interval (month, day,week...). You are trying to use some "Dummy" member in time dim, in this case you will have issues with the historical values...

Former Member
0 Kudos

The historical aspect is a valid point. One i'm always very carefull with.

But in this case it's a "interim storage" of loaded data, which will be copied to a specific time and category, thus ensuring that budget assumptions are stored.

regards

jdalby

SimonLH
Explorer
0 Kudos

Used this to copy assumptions to many entities. Very useful. Thanks

Answers (0)