cancel
Showing results for 
Search instead for 
Did you mean: 

How to select a base member based on PARENTH1 in script logic ?

Former Member
0 Kudos
431

HI ,

My requirement is simple of allocation

consider a simple Hier as below

                          

IDH1Surrogate
America
 
    US
America
   CanadaAmerica
America_defaultAmericaY

The value will be posted to the "America_default" and that value needs to be alloc for the base members of Parent "America".

This had to be dynamic.

Is there any way we can access the Surrogate(America_default) ,if the user selects the Top node(America) when execution. ??

I know a work around by adding a property and entering the Surrogate Id at the parent level and then access it via SELECT

but we have a huge Hier structure and maintaining this will be a nightmare

does anyone has a better solution ?

Thanks in advance

Aamer

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Hi Aamer,

If you always attach the same suffix to the node name you can use something like:

%NODEMEMBER%_default

B.R. Vadim

Former Member
0 Kudos

Hi Vadim,

Yes I agree with u,but business is not agreeing on this.

Any other alternatives for this.

thanks

Aamer

former_member186338
Active Contributor
0 Kudos

Then only properties with ID:

1. Property of Surrogate ID with Node ID

or

2. Property of node ID with Surrogate ID

PARENTH1 is not supported in SELECT, no way.

Vadim

former_member186338
Active Contributor
0 Kudos

But I prefer suffix approach . Can be used in FOR/NEXT loop - no SELECT!

Former Member
0 Kudos

I too prefer the suffix method .

and thanks Vadim for confirming that PARENTH1 is not supported in SELECT.

I was beating my head to get the parentH work in select

one more question

Is there anyway we can access parentH1 for the surrogate via the BADI ??

former_member186338
Active Contributor
0 Kudos

For sure you can access parenth1 in the badi, but in this case you will have to perform allocation also using your own code in the same badi. Looks like a high price for business not accepting suffix idea

B.R. Vadim

former_member186338
Active Contributor
0 Kudos

P.S. If business don't like suffix may be they prefer prefix

Former Member
0 Kudos

Hi Vadim,

thanks for the reply

In addition to above ,the requirement for allocation is

the user will select dimensions  as below in DM package

Account =Any parent node (or leal level)

Product=Any parent Node

ProfitCenter=Any top node

Audit= ALL (top node)

and they want to allocate to the base of ProfitCenter and post it to a diff Audit member.

The slice of data for allocation should remain the same for acct and products

----CODE------------------------------

*RUNALLOCATION

*FACTOR = USING/TOTAL

*DIM ACCOUNT  WHAT=BAS($ACCT_NODE$) ;WHERE=<<<; Using=DRIVER_ACCT; Total=<<<

*DIM PROFITCENTER WHAT=REGION_DEFAULT ;WHERE=BAS($REGION$); Using=<<<; Total=<<<

*DIM AUDIT   WHAT=BAS($ALL_AUDIT$) ;WHERE=ALLOC; Using=BAS($ALL_AUDIT$)

*DIM PRODUCT   WHAT=BAS($PROD_NODE$);WHERE=<<<; Using=<<<; Total= <<<

*ENDALLOCATION

-------------------------------------------

In Audit they want USING to be complete hier, that's the reason I have not given TOTAL in that line.

I am doubt full whether the code will post properly or not,bcoz they are aggregating 3 dimensions values ?

and my 2nd question is it possible that....if we provide the user with flexibility of selection of top node or leaf level.Will we be able to handled in the code.?

Ex: If the user select child node and my code is BAS($MEMBER_NAME$)..this will give an error.

Thanks

Aamer

former_member186338
Active Contributor
0 Kudos

Easy answer for easy question: "

and my 2nd question is it possible that....if we provide the user with flexibility of selection of top node or leaf level.Will we be able to handled in the code.?

Ex: If the user select child node and my code is BAS($MEMBER_NAME$)..this will give an error."

Not possible! nodes OR base members! Different scripts for this 2 cases. No conditional code execution in script logic.

Second: if you use *FACTOR = USING/TOTAL then all *DIM are required to have both USING and TOTAL defined.


Vadim

Former Member
0 Kudos

Thanks for the answer for node and child level.

Secondly for allocation if I give TOTAL for the AUDIT DIM it is posting 0 only.

when i remove TOTAL it post the values.

Thanks

aamer

former_member186338
Active Contributor
0 Kudos

Please, show UJKT log!

Former Member
0 Kudos

Below is the UJKT log....(For Account & Product presently I am running on one base member for testing purpose)

LGX:

*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM ACCOUNT WHAT=A901 ;WHERE=<<<; Using=3302; Total=<<<
*DIM PROFIT_CENTER WHAT=REGION_DEFAULT ;WHERE=BAS(PCG00001); Using=<<<; Total=<<<
*DIM AUDIT WHAT=BAS(ALL_AUDIT) ;WHERE=7P; Using=BAS(ALL_AUDIT)
*DIM PRODUCT WHAT=PRODUCT_11 ;WHERE=<<<; Using=<<<; Total= <<<
*ENDALLOCATION

-------------------------------------------------------------------------------------------------------------------------------------
LOG:

LOG BEGIN TIME:2014-02-05 22:56:28

USER:*****
APPSET:REV
APPLICATION:FINANCE
FACTOR:USING/TOTAL
ALLOCATION DATA REGION:
ACCOUNT:WHAT:A901,WHERE:<<<,USING:3302,TOTAL:<<<
PROFIT_CENTER:WHAT:REGION_DEFAULT,WHERE:BAS(PCG00001),USING:<<<,TOTAL:<<<
AUDIT:WHAT:BAS(ALL_AUDIT),WHERE:7P,USING:BAS(ALL_AUDIT),TOTAL:
PRODUCT:WHAT:PRODUCT_11,WHERE:<<<,USING:<<<,TOTAL:<<<
-----------------------------------------
--Read WHAT region
[ACCOUNT] =A901
[PROFIT_CENTER] =REGION_DEFAULT
[AUDIT] =70,71,72,73,74,75,76,7F
--Time to load WHAT :0.305107 second(s).
WHAT data:5  records.
-----------------------------------------
--Read USING region
[ACCOUNT] =3302
[PROFIT_CENTER] =PCG00003,PCG00005,PCG00009,PCG00010,PCG00011,PCG00012,PCG00017,PCG00018,PCG00019
--Time to load USING :0.253782 second(s).
USING data:16  records.
-----------------------------------------
--Merge WHAT and USING
--Time to merge WHAT and USING :0.000303 second(s).
Data after merging WHAT and USING :16  records.
-----------------------------------------
--Apply factor
[ACCOUNT] =3302
[PROFIT_CENTER] =PCG00003,PCG00005,PCG00009,PCG00010,PCG00011,PCG00012,PCG00017,PCG00018,PCG00019
TOTAL data:16  records.
WHERE=WHAT *USING/TOTAL
--Time to apply factor :0.170862 second(s).
-----------------------------------------
--Read destination and calculate difference
[ACCOUNT] =A901
[PROFIT_CENTER] =PCG00003,PCG00005,PCG00009,PCG00010,PCG00011,PCG00012,PCG00017,PCG00018,PCG00019
--Time to read destination and calculate difference :0.142184 second(s).
-----------------------------------------
--Records succeeded to write back :12
--Records failed to write back 0
-----------------------------------------
--Time to run Allocation :1.681953 second(s).

SCRIPT RUNNING TIME IN TOTAL:2.27 s.
LOG END TIME:2014-02-05 22:56:28

former_member186338
Active Contributor
0 Kudos

Ups, the behavior of *FACTOR = USING/TOTAL looks like depending on BPC SP level...


Vadim

Former Member
0 Kudos

if i remember correctly in my previous project ....i have also done same kind of coding by removing TOTAL  for one dimension.

i think it was BPC 10 SP8

former_member186338
Active Contributor
0 Kudos

And I remember some case that without defined total the error was generated...

former_member186338
Active Contributor
0 Kudos

Just to check, what will happen if:

*DIM AUDIT WHAT=BAS(ALL_AUDIT) ;WHERE=7P; Using=BAS(ALL_AUDIT); Total=<<<

Former Member
0 Kudos

UJKT log with the TOTAL

LGX:

*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM ACCOUNT WHAT=A901 ;WHERE=<<<; Using=3302; Total=<<<
*DIM PROFIT_CENTER WHAT=REGION_DEFAULT ;WHERE=BAS(PCG00001); Using=<<<; Total=<<<
*DIM AUDIT WHAT=BAS(ALL_AUDIT) ;WHERE=7P; Using=BAS(ALL_AUDIT); Total=<<<
*DIM PRODUCT WHAT=PRODUCT_11 ;WHERE=<<<; Using=<<<; Total= <<<
*ENDALLOCATION

-------------------------------------------------------------------------------------------------------------------------------------
LOG:


USER:*****
APPSET:****
APPLICATION:*****
FACTOR:USING/TOTAL
ALLOCATION DATA REGION:
ACCOUNT:WHAT:A901,WHERE:<<<,USING:3302,TOTAL:<<<
PROFIT_CENTER:WHAT:AMS_REGION_DEFAULT,WHERE:BAS(PCG00001),USING:<<<,TOTAL:<<<
AUDIT:WHAT:BAS(ALL_AUDIT),WHERE:7P,USING:BAS(ALL_AUDIT),TOTAL:<<<
PRODUCT:WHAT:PRODUCT_11 ,WHERE:<<<,USING:<<<,TOTAL:<<<
-----------------------------------------
--Read WHAT region
[ACCOUNT] =A901
[PROFIT_CENTER] =REGION_DEFAULT
[AUDIT] =70,71,72,73,74,75,76,7F
--Time to load WHAT :0.134861 second(s).
WHAT data:5  records.
-----------------------------------------
--Read USING region
[ACCOUNT] =3302
[PROFIT_CENTER] =PCG00003,PCG00005,PCG00009,PCG00010,PCG00011,PCG00012,PCG00017,PCG00018,PCG00019
--Time to load USING :0.147687 second(s).
USING data:12  records.
-----------------------------------------
--Merge WHAT and USING
--Time to merge WHAT and USING :0.000241 second(s).
Data after merging WHAT and USING :12  records.
-----------------------------------------
--Apply factor
[ACCOUNT] =3302
[PROFIT_CENTER] =PCG00003,PCG00005,PCG00009,PCG00010,PCG00011,PCG00012,PCG00017,PCG00018,PCG00019
TOTAL data:12  records.
WHERE=WHAT *USING/TOTAL
--Time to apply factor :0.150816 second(s).
-----------------------------------------
--Read destination and calculate difference
[ACCOUNT] =A901
[PROFIT_CENTER] =PCG00003,PCG00005,PCG00009,PCG00010,PCG00011,PCG00012,PCG00017,PCG00018,PCG00019
--Time to read destination and calculate difference :0.140991 second(s).
-----------------------------------------
--Records succeeded to write back :10
--Records failed to write back 0
-----------------------------------------
--Time to run Allocation :0.634728 second(s).

SCRIPT RUNNING TIME IN TOTAL:0.87 s.
LOG END TIME:2014-02-06 20:04:08

former_member186338
Active Contributor
0 Kudos

And what about results? Correct or?

Former Member
0 Kudos

Hi Vadim,

If TOTAL is present it doesn't post values.

When removed it posts the values.


Bur Vadim my major concern is .......Allocation is only happening for one Dim (Profit center) but for other dimensions they are selecting the Parent nodes(i.e they want to aggregate and then do allocation for the profit center).
Will my code post correct values or do i need to have for loop for this ??

Thanks
Aamer

former_member186338
Active Contributor
0 Kudos

I don't understand you:

In the previous post the values were written (10 records) with Total present:Total=<<<)


"If TOTAL is present it doesn't post values. When removed it posts the values."??

For the rest I am unable to understand the logic without looking on the model... Can you provide some SIMPLE sample that make things clear?

Vadim

Former Member
0 Kudos

Hi Vadim

I am interested to understand the requirement what was the original concern posted by Aamer & what does below comment mean -

If you always attach the same suffix to the node name you can use something like:

%NODEMEMBER%_default

Thanks !!

JAck

former_member186338
Active Contributor
0 Kudos

Hi Jack,

The idea behind is simple:

You have something like

Parent1

  Member1

  Member2

  Member3

Parerent1_default

Data entry is done in Parerent1_default and this value has to be allocated to base members of Parent1.

The allocation is done by DM package and the user is prompted to enter Parent1.

Then WHAT can be defined as %PARENTMEMBER%_default and WHERE as BAS(%PARENTMEMBER%)

Vadim

Former Member
0 Kudos

Hi Vadim,

just for info

I am able to handle the base members and node members by a work around in alloc .

With assigning the user selection to a variable as below.

below code for the same

*XDIM_MEMBERSET ACCOUNT AS %ACCT_VAR%=BAS(%ACCOUNT_SET%)
*XDIM_MEMBERSET PRODUCT AS %PROD_VAR%=BAS(%PRODUCT_SET%)
*XDIM_MEMBERSET AUDIT=BAS(ALL_DOCTYPE)

*FOR %ACCT%=%ACCT_VAR%
*FOR %PROD%=%PROD_VAR%
*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM ACCOUNT  WHAT=%ACCT% ;WHERE=<<<; Using=Driver; Total=<<<
*DIM PROFIT_CENTER WHAT=REGION_DEFAULT ;WHERE=BAS(%PROFIT_CENTER_SET%); Using=<<<; Total=<<<
*DIM AUDIT   WHAT=BAS(ALL_DOCTYPE) ;WHERE=7P; Using=BAS(ALL_DOCTYPE); Total=<<<
*DIM PRODUCT   WHAT= %PROD%;WHERE=<<<; Using=<<<; Total=<<<
*DIM TIME WHAT=%TIME_SET%;WHERE=<<<; Using=<<<; Total=<<<
*ENDALLOCATION
*NEXT
*NEXT

This is working...u can try for diff combinations of Parent member ,children from DM package

thanks

Aamer

former_member186338
Active Contributor
0 Kudos

Hi Aamer,

To my mind it's possible to simplify the code you have. Please look on the help sample number 3. There are number of mistakes in this sample, but some ideas can be used. Unfortunately I can't test code on your system

B.R. Vadim

Answers (0)