Sie sind auf Seite 1von 4

Data Transformations - SAP Documentation

http://help.sap.com/saphelp_bpc70sp02/helpdata/en/5d/9a3fba600e4de29e2d165644d67bd1/content.htm

Data Transformations
You define data transformations so that you can map external data to internal BPC data structures.

Features
Prerequisites To perform data transformations, there must be at least two BPC for Microsoft Excel workbook files. These required files are described in the following table: File Transformation file Description This file allows you to set up the rules for reading data from an external source and put it in the proper form for your BPC database. Transformation files are Microsoft Excel files that contain one worksheet, named Instructions. The Instructions worksheet has the following sections: *Options *Mapping *Conversion Conversion file This file allows you to map member names from external to internal dimension structures. You can set up multiple sheets in a conversion file so that many transformations can access the same conversion workbook. You can have one conversion file per dimension. See Data Conversions.

After you set up these files, you run packages to use these files to define your data transformations. See Running and Scheduling Packages. NOTE All dimensions of an application must be mapped in the transformation. So if the import file does not have a dimension (such as DATASRC), then you would use *NEWCOL (see below). Options Section The *Options section of the Transformation file contains definitions for various options that you can set for your transformation. The following table contains a list of available options and descriptions for each option: Option AMOUNTDECIMALPOINT=text character Default . (period) Description This option allows you to specify a nonperiod decimal point for countries that use a different character, such as a comma. The character specified in this option must differ from the character specified for the DELIMITER. This option specifies which dimension to look at for value calculations. You must specify a dimension conversion sheet using the Amount *Conversion option. For more information about conversion files, see Data Conversions. If there is no formula in the Formula column of the Amount conversion sheet, this parameter has no effect at all. For example, in a case where the Formula column has the following formula: <value>*1.10, all accounts are increased by 10% during the conversion. This option compares input member names with columns in the conversion file. If NO, the input member names are compared with the external column in conversion file. If YES, the input member names are compared with the internal column in conversion file. RECOMMENDATION Do not change the default setting. This setting is here for the purposes of backward compatibility only. There are no reasons to change this in BPC 7.0 and later versions. CREDITNEGATIVE= YES | NO YES This option reverses the signs for a given account. If this parameter is set to NO, the option reverses the sign for all amounts referring to an ACCOUNT type (LEQ, INC). This option defines the single character that is the delimiter between columns if the FORMAT option is set to DELIMITED, Use the keywords SPACE or TAB if the columns are delimited by spaces or tabs. This option defines the format of the data in the input or output file. DELIMITED means that there is a special character between each column of data, defined by the DELIMITER option (above). FIXED means that the data is in a fixed field format. For this setting, use the FCOL mapping option. NOTE VARIANT is out of scope for BPC 7.0 FORMULA = LIB.LGF|LIB1.LGF <empty> This option sets the K2 functions referenced by the master data members formula attribute. This option is only used for importing master data. It is illegal when running other packages. The libraries are syslib. The *syslib prefix is not needed here. Different libraries are separated by |. NOTE This is used for loading master data as is (new in BPC 7.0). EXAMPLE DAVY_KP1_DEV7A2_Q_Mdxlib_1.LGF| DAVY_KP1_DEV7A2_Q_Mdxlib_2.LGF

CONVERTAMOUNTWDIM=dimension name

<Account>

CONVERT_INTERNAL = YES | NO

NO

DELIMITER text_character| SPACE | TAB

, (comma)

FORMAT = DELIMITED | FIXED | VARIANT

There is no default. This is a required option.

1 of 4

08/02/2013 17:01

Data Transformations - SAP Documentation

http://help.sap.com/saphelp_bpc70sp02/helpdata/en/5d/9a3fba600e4de29e2d165644d67bd1/content.htm

Option HEADER= YES | NO

Default YES

Description This option specifies if you data has a header ro. If this parameter is set to YES, then your input file contains one header row that defines the fields. If you do have a header row, you can refer to a field by name in the MAPPING section. This option specifies the number of rejected records at which to stop processing if you are validating records. A value of -1 implies that the Data Manager should keep processing, no matter how many rejected records exist. The default value is 500, which can be represented by an empty string. This option specifies the amount of decimal places to which values are to e rounded during the transformation. By default, there is no rounding during data transformation. If you use this option, you must enter a parameter. The integer can be zero or any positive integer. This option sets the selection rules when you are extracting transaction data from an infoprovider. Use the following parameter definitions to set your selection: <Dimension1_techname> is the technical name of the dimension. <Dimension1_value> is the value of a condition statement set to this dimension. EXAMPLE 0SX_ACCS, US;0SX_CSLC, 1 is the result of the following selection statement: 0SX_ACCS=US and 0SX_CSLC= 1 This option is only used for importing transaction data from an infoprovider. It is illegal when running other packages. NOTE This is used for loading transactional data as is (new in BPC 7.0).

MAXREJECTCOUNT=empty_string | -1 | positive number

empty_string

ROUNDAMOUNT=integer

There is no default. You must define this option.

SELECTION = <Dimension1_techname>, <Dimension1_value>;<Dimension2_techname>, <Dimension2_value>

<empty>

SKIP= integer

0 (zero)

This option specifies the number of lines to skip at the top of a data file. EXAMPLE Use this option to skip header lines during transformation.

SKIPIF= text_string | text_string2

empty_string

This option causes the transformation to skip a line in the data file if it begins with the specified strings. The strings are separated by |, in the above case. If a record contains <text_string> or <text_string2>, the record is skipped. To include all lines in the transformation, set this option to an empty string. If you use this option, you must enter a parameter. This option specifies whether or not to validate records. If this parameter is set to No, the validation does not occur. If this parameter is set to Yes, check the following items before the import: Validate the mapping. Ensure that the members exist. Verify that the record is proper for the BPC application. When this option is enabled, the following rules apply: If a member ID is not mapped, the record associated with the ID is rejected during validation and ignored. If the import file has an extra field that is not mapped, all records are rejected during validation.

VALIDATERECORDS= No | Yes

No

Mapping Section The *Mapping section of the transformation file defines how data is mapped to your BPC database. EXAMPLE For a header row and that defines a column named AccountVal, you can map the Account dimension to the Account field from the data file this way: Account = AccountVal The following table details the available mapping functions: Mapping Function *COL(A) Parameters A = column index in the data file Description This function defines a dimension for a field in the data file when the data file does not have a header row. See the note below about automatic field names when you do have a header row. EXAMPLE Account =*COL(2) *COL(A, B:C) A = column index in the data file B:C = the start and end positions within the column This function defines a dimension for a subset of a field in the data file. EXAMPLE Account=*COL(3,1:4)

*FCOL(A:B)

A:B = the start This option allows you to define the start and end character columns for each field when you are using Fixed format data files, In the example and end positions below, the columns 4 through 7 represent the Account dimension. within the data row EXAMPLE Account=*FCOL(4:7) A:B = the start and end time period columns This function allows you to use multiple time period columns. EXAMPLE If you have a number of consecutive columns that are based on time periods, you can use this function to include all of them. In the following set of columns, you can use the following command:

*MVAL(A:B)

2 of 4

08/02/2013 17:01

Data Transformations - SAP Documentation

http://help.sap.com/saphelp_bpc70sp02/helpdata/en/5d/9a3fba600e4de29e2d165644d67bd1/content.htm

Time = *MVAL(7:18) Account,Category,DATASRC,entity,IntCo,RptCURRENCY,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC Using this command requires that you use a time.xls conversion sheet. To see the sample time.xls conversion file, open the existing conversion definition window. If your data does not have a header row, the time periods are named P1, P2, P3,...,PN by default. *NEWCOL(A) A = dimension member This function creates a new field with the given value. EXAMPLE Account=*NEWCOL(Revenue) *Str(string) Not applicable This function adds a text string to the members of a column. This function is useful if you need to map data file fields to fields in your database that have the same names, except that the field names contain extra characters (either before or after the name). EXAMPLE Entity = *Str(NE) + *COL(1) *PAD Not applicable This function is used for padding imported fields. EXAMPLE To prepend the letter A to a field (such as the member ID) use *PAD(A). If the field contains 123 before the command, the resulting value is A123. *If (Condition1 then Action1;Condition2 then Action2;Default Action) BPC takes the following actions, depending on the results of the condition evaluations: Condition1 - If this evaluates to True, map using Action1 Condition2 - If Condition1 is "False" and Condition2 is "True," map using Action2 Default Action - If both Condition1 and Condition2 are "False", map using this Default Action Condition1 and Condition2 can contain multiple items that are added together (using the plus + sign). This function allows you to test a series of conditions, and to apply a corresponding action if the condition is true. EXAMPLE Product=*if (Product+ID+Entity = *str(148552) then *str(MHarn);ID(1:1) = *str(C) then *str(XX) ; *str(YY)) Explanation: This means that if the sum of the product, ID, and entity value are equal to 148552 then change product value to MHarn or Else IF first value of ID field is equal to C then Change Product value to XX Else change product value to YY NOTE The *STR() function must be used when evaluating numeric constants in an *IF statement. EXAMPLE Examine the following series of data sets, mapping function examples, and result sets to gain an understanding of how the *IF function can be used in various scenarios: Data Set 1: PRODUCT,ID,ENTITY 14,85,52 AB,CD,EF GH,IJ,KL Mapping Function 1: Product=*IF (product+ID+Entity=*Str(148552) then *str(MHarn);ID(1:1) = *str(C) then *str(XX) ; *str(YY)) Result Set 1: PRODUCT,ID,ENTITY MHarn,85,52 AB,XX,EF YY,IJ,KL Data Set 2: Entity, SEntity U1000000, US01 Z2000A01, CA03 K3430000, JP04 Mapping Function 2: Entity=*IF(*col(1,1:1)=U then SEntity;*col(1,1:1)=Z then *col(1,3:6); *STR(ERR)) Result Set 2: Entity, SEntity US01, US01 A01, CA03 ERR, JP04 Conversion Section The *CONVERSION section of the transformation file defines which conversion sheet to use with which dimensions. Use the following syntax to associate a dimension with a conversion sheet: Dimension Name = [COMPANY]WorkbookName[!SheetName] NOTE Items in brackets are optional. The following table describes the variables. Variable DimensionName Description Either the dimension name to correlate with the conversion file or the keyword Amount. Use the Amount option to specify the conversion file to be used if you specify the ConverAmountWDim option in the *Options section. This allows you to use a formula to scale the input or output values. The name of the conversion file This is the name of the worksheet to use within the conversion file. If a name is not specified, the system assumes the sheet name is Conversion. If [COMPANY] is defined then the Data Manager tries to obtain the conversion file from the main company Data Manager folder. Otherwise the Data Manager looks in the appropriate Site folder.

Workbookname SheetName

[COMPANY]

Activities
To create a new transformation file, select To edit transformation files, select eData eData New Transformation File. Enter data as required. then browse to the desired file. Enter data as required. Maintain transformations Manage Manage Transformation Files,

To copy a transformation file, open the file you want to copy by selecting Manage Data from the Getting Started - BPC for Excel action pane. Select existing transformation. Open the desired file and select Copy Transformation File. To copy dimension files between applications, you create a transformation file to map the dimensions. See Sample Transformation File.

Example
3 of 4 08/02/2013 17:01

Data Transformations - SAP Documentation

http://help.sap.com/saphelp_bpc70sp02/helpdata/en/5d/9a3fba600e4de29e2d165644d67bd1/content.htm

In this example, AccountConv.xls is the name of the Account dimension conversion file. Account = AccountConv.xls Amount = AccountConv.xls (Use the Amount keyword with the ConvertAmountWDim transformation option.) Account = AccountConv.xls!newaccount Account = [COMPANY]AccountConv.xls!newaccount

More Information
Data Conversions Sample Transformation File

4 of 4

08/02/2013 17:01