cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the Months of an year read dynamically from Dimension Property

former_member339201
Participant
0 Kudos

Hi ,

I have come across a scenario to loop on months of an year selected dynamically from the property.

suppose the plan year = 2015 for a business and I want to loop on 12 months of this plan year to add the calculated and adjustment data into another  VERSION like this .

*XDIM_MEMBERSET TIME AS %PLAN_MONTH% = BAS(2015.TOTAL)

*XDIM_MEMBERSET VERSION = PLAN

*WHEN AUDITTRAIL

*IS CALC , ADJ

*FOR %TIME_MEM% = %PLAN_MONTH%

*WHEN TIME

*IS %TIME_MEM%

*REC(FACTOR = 1 , VERSION = FORECAST , AUDITTRAIL = CALC )

*ENDWHEN

*NEXT

ABOVE CODE WORKS FINE. IT ADDS DATA FROM TWO AUDIT TRAILS AND POSTS IT TO ANOTHER VERSION, AND IN CALC AUDITTRAIL.

ABOVE is the code when I am hardcoding the Year as 2015. Now I am reading year from property as :

*SELECT ( %PLANYEAR% , [PLAN_YEAR] , VERSION , ID  = AOP) 

*XDIM_MEMBERSET TIME AS %PLAN_MONTH% = BAS(%PLANYEAR%.TOTAL)    // this line is showing me the error

*XDIM_MEMBERSET VERSION = PLAN

*WHEN AUDITTRAIL

*IS CALC , ADJ

*FOR %TIME_MEM% = %PLAN_MONTH%

*WHEN TIME

*IS %TIME_MEM%

*REC(FACTOR = 1 , VERSION = FORECAST , AUDITTRAIL = CALC )

*ENDWHEN

*NEXT

So I want to get the plan year  months to loop on it. Please suggest how can I do it.

Thanks,
SHUBHAM

Accepted Solutions (1)

Accepted Solutions (1)

Shrikant_Jadhav
Active Contributor
0 Kudos

Hi Shubham,

Can you try this

*XDIM_MEMBERSET TIME AS %PLAN_MONTH% = %PLANYEAR%.01,%PLANYEAR%.02,%PLANYEAR%.03,...,%PLANYEAR%.12


P.S. not tested ...


Shrikant

former_member339201
Participant
0 Kudos

Thanks Srikant,

That was helpful and didnot given any syntax issue.

But in one of the scipt logic primer books i came across BAS(%PLANYEAR%.TOTAL) and in BPC.10.1 it is giving an error.

Shrikant_Jadhav
Active Contributor
0 Kudos

Hi Shubham,

Not sure but what I think you can not have two variables in *XDIM_MEMBERSET like


*XDIM_MEMBERSET TIME AS %PLAN_MONTH% = BAS(%PLANYEAR%.TOTAL)


if you change it as


*XDIM_MEMBERSET TIME = BAS(%PLANYEAR%.TOTAL) it will work.



Shrikant

Answers (1)

Answers (1)

bhagyesh_ravange
Active Participant
0 Kudos

Hello Shubham,

On which Dimension you are applying SELECT function and what is "AOP" in select function.

Can you try below script:

*SELECT (%PLANYEAR%,"[PLAN_YEAR]",VERSION,"[ID]"  = AOP)

*XDIM_MEMBERSET TIME = BAS(%PLANYEAR%.TOTAL)

*XDIM_MEMBERSET VERSION = PLAN

*WHEN AUDITTRAIL

*IS CALC , ADJ

*FOR %TIME_MEM% = BAS(%PLANYEAR%.TOTAL)

*WHEN TIME

*IS*

*REC(FACTOR = 1 , VERSION = FORECAST , AUDITTRAIL = CALC )

*ENDWHEN

*NEXT

former_member339201
Participant
0 Kudos

Hi All,
Thanks for Response. AOP is a dimension member against which 2015 value is maintained in the PLAN_YEAR property in VERSION dimension.

@Shrikant ,Bhagyesh :
The following statement is giving syntax error in script logic. I had tried this out earlier also.

*XDIM_MEMBERSET TIME = BAS(%PLANYEAR%.TOTAL)


error says : No members found in dimension time for " CALC = N"

bhagyesh_ravange
Active Participant
0 Kudos

Have you tried to execute the Script logic in UJKT. Sometimes script logic does not validate but it works and get executed in UJKT. could you execute the script logic in UJKT and  share the result of same.

former_member339201
Participant
0 Kudos

We have tried it out earlier . ujkt shows the same above error as shown in web admin.

Shrikant_Jadhav
Active Contributor
0 Kudos

Hi Shubham,

Which BPC version you are using NW or MS ?


In BPC MS , BAS() will not work with XDIM_MEMBERSET.



Shrikant

bhagyesh_ravange
Active Participant
0 Kudos

Could you share the screen shot of UJKT, just execute and share the error which you are getting.