cancel
Showing results for 
Search instead for 
Did you mean: 

Script logic in packages: take variables from package

0 Kudos

Hi all,

I have a package where the user must select Time dimension member. I know that the selected value is saved in the variable %TIME_SET%. Imagine the user select 2015.JUN. I would like to run a script for all months of 2015, but I don't know how to code the selection of the year of the member selected by the user in the package.

I have tried using %YEAR%, but it does not work, as %YEAR% is the year of the temporal registers, not the year selected in the package.

Any idea?

Best regards,

Fernando

Accepted Solutions (1)

Accepted Solutions (1)

Shrikant_Jadhav
Active Contributor
0 Kudos

Hi Fernando,

Use this


*SELECT(%YR%,"[YEAR]",TIME,"[ID]='%TIME_SET%')


Shrikant

Shrikant_Jadhav
Active Contributor
0 Kudos

For more details kindly refer the following thread

Shrikant

0 Kudos

Thank you very much for all your answers, but they are not enough.

I need the year to to run CALC_ACCOUNT logic for all months of the year selected.

The logic is like this:

....

*SELECT(%YR%,"[YEAR]",TIME,"[ID]='%TIME_SET%')

*RUN PROGRAM RUNCALC_ACCOUNT

CATEGORY=%CATEGORY _SET%

TID_RA= ?????

OTHER=[COMPANY=%COMPANY_SET%]

CALC=DEPN

*ENDRUN_PROGRAM

After this logic, other logic is run to calculate the opening flow of everymonth using closing month of previous month:

*RUNALLOCATION

*FACTOR=1

*DIM ACCDETAIL WHAT=BAS(DT_CLO); WHERE=DT_OPE

*DIM TIME WHAT = %YR%.01;  WHERE = %YR%.02

*ENDALLOCATION


*RUNALLOCATION

*FACTOR=1

*DIM ACCDETAIL WHAT=BAS(DT_CLO); WHERE=DT_OPE

*DIM TIME WHAT = %YR%.02;  WHERE = %YR%.03

*ENDALLOCATION

.....

Which is the code I must write after TID_RA=? If I write for example %YR%.01, when I run the package, I get an error saying: "Member 2011 is not a valid base member". It is like when you write %YR%.01 in the TID_RA section, it only understand until the point.

Any ideas?

former_member186338
Active Contributor
0 Kudos

Hi Fernando,

TID_RA=%YR%.01,%YR%.02,%YR%.03,...,%YR%.12



Or:


*SELECT(%YMONTHS%,"[ID]",TIME,"[YEAR]=%YR% AND [CALC]='N'")

TID_RA=%YMONTHS%


Vadim

0 Kudos

Second option is the correct one, The first one does not work.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Fernando,

have you tried to select 2015.TOTAL

Andy

Former Member
0 Kudos

Hi,

You can use BAS(%TIME_SET%) in your *XDIM_MEMBERSET statement.

This way, if a user then selects a node, for example 2015.TOTAL, this will run the calculation for all basmembers of the selected node. If an individual bas member is selected, the logic script will run for this specific month.

With kind regards,

Tim

0 Kudos

It is not possible, in the package you can only select base members.