cancel
Showing results for 
Search instead for 
Did you mean: 

BPC 7.0 SP6 Script Issue

Former Member
0 Kudos

Hi,

I'm trying to create new records with YTD values.

Therefore I need to select all records of the current selected year.

(in case JAN values are changed, all following month values have to be changed as well)

Following the script code so far:


// Add EUR for statistical keyfigures
*SELECT (%ACCSET%, "[ID]", P_ACCT, "[RATETYPE]='STAT'")
*XDIM_ADDMEMBERSET P_ACCT = %ACCSET%
*SELECT (%TIMSET%, "[ID]", TIME, "[LEVEL]='MONTH'")
*XDIM_ADDMEMBERSET TIME = %TIMSET%

*WHEN P_ACCT.RATETYPE
*IS "STAT"

// CURR = LC, P_MEASURE = YTD
*REC(EXPRESSION=([MEASURES].[YTD]), P_MEASURE="YTD")

// CURR = EUR
*REC(FACTOR=1, RPTCURRENCY="EUR")
*REC(EXPRESSION=([MEASURES].[YTD]), RPTCURRENCY="EUR", P_MEASURE="YTD")

// CURR = CHF
*REC(FACTOR=1, RPTCURRENCY="CHF")
*REC(EXPRESSION=([MEASURES].[YTD]), RPTCURRENCY="CHF", P_MEASURE="YTD")

*ENDWHEN

*COMMIT

(for your information: P_MEASURE was created to deal with currency issues

YTD values converted at todays rate vs. cumulated monthly values at month rate)

The script selects currently all defined time periods with LEVEL = MONTH.

Something like


*SELECT (%TIMSET%, "[ID]", TIME, "[LEVEL]='MONTH'" AND "[YEAR]=%TIME_SET%.YEAR")

did not work.

Can anyone give a hint how to restrict the selection to current year values?

Thanks.

Regards

Steve

Edited by: Steve Scheidig on Feb 18, 2011 6:50 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can refine your script logic to below:

*SELECT (%TIMSET%, "[ID]", TIME, "[LEVEL]='MONTH'" AND "[YEAR]=%YEAR%")

Hope this helps.

former_member200327
Active Contributor
0 Kudos

I think that this will bring months from current year defined based on current server date.

If you need year selected in DM prompt replace %YEAR% with %TIME_SET%. Just make sure you selecting one year only.

Former Member
0 Kudos

Hi,

I want to use this script for entering data via layout.

Unfortunately selections using

YEAR=%YEAR%

or

YEAR=%TIME_SET%

or

YEAR=%TIME_SET%.YEAR

or

YEAR=%TIME_SET%.[YEAR]

do not work. (Maybe because of the current version/SP?)

Does anyone have an example for selecting data of a whole year, depending on currently selected month or current set of data?

Thanks.

Regards

Steve

Former Member
0 Kudos

Hi,

This is a 2 step process

1st Step: Fetch the value of the YEAR property from the TIME_SET

*SELECT (%MY_YEAR%, "YEAR", TIME, "ID=%TIME_SET%")

2nd Step: Fetch all the months of the year

*SELECT (%TIMSET%, "ID", TIME, "LEVEL='MONTH'" AND "YEAR=%MY_YEAR%")

Hope this helps.

Former Member
0 Kudos

Hi Nilanjan,

it seems, that it is not possible to use the *SELECT statement together with a variable.

A fix selection is working

//select 2010
*SELECT (%TIMSET%, "ID", TIME, "LEVEL='MONTH'" AND "YEAR=2010")
*XDIM_ADDMEMBERSET TIME = %TIMSET%
//select 2011
*SELECT (%TIMSET2%, "ID", TIME, "LEVEL='MONTH'" AND "YEAR=2011")
*XDIM_ADDMEMBERSET TIME = %TIMSET2%

But whenever I tried to include %MY_YEAR% the selection failed. (no error message, but the memberset selection was not extended)

I will now check with the customer, if a change of the script each year is dynamic enough.

Thanks for your effort!

Regards

Steve