Create Datamart Table with Dynamic Fields Step – create-dynamic-data-mart

Type

Description

Type

Description

create-dynamic-data-mart

Creates a Datamart with dynamic fields (unknown name of the key fields) according to the step specification.

Setup of Datamart creation is stored to Advanced Configuration by this name: dmName-fieldMapping {"fieldsMapping":[{"sourceDs":"Product","targetDs":"","originalFieldName":"ProductId","currentFieldName":"test"}]}

Data Requirements

In the package directory in the data folder, this step requires:

  • Datamart folder (keeping the structure and naming conventions as provided by Packaging Tool).
    In contrast, the create-data-mart step does not need this folder because a new Datamart is created from scratch, whereas in this step fields are mapped to an existing Datamart.

 There must be a Datamart system field specified in the folder structure Datamart/dsName/datamart.json in order for the step to work.

Specific Attributes

Attribute Name

Description

Example

Required

Attribute Name

Description

Example

Required

dmName

Specifies a name of the Datamart.

"dmName": "Standard_Sales_Data"

true

dmLabel

Specifies a label of the Datamart.

"dmLabel": "Standard Sales Data"

true

dataSources

Specifies a list of Data Source names which will be included in the Datamart.

"dataSources": [ "Product" ]

false

sourceName

Specifies a name of a Data Source which will be used as a Datamart source.

"sourceName": "TXStandardData"

true

fieldsWithFunction

Specifies a list of Datamart fields with their specific function in the Datamart. Each object must have these attributes:

  • uniqueName – Name of a field in the Datamart.

  • function – Name of a function supported by Pricefx and Datamart entity.

"fieldsWithFunction": [ { "uniqueName": "PricingDate", "function": "PRICINGDATE" }, { "uniqueName": "Quantity", "function": "PERUNITBASIS" }, { "uniqueName": "InvoicePrice", "function": "PERCENTBASIS" } ]

false

excludedFields

Excludes fields from the given Data Sources. Fields must be array assigned to a specified Data Source.

"excludedFields": {   "TXStandardData": [     "Currency"   ],   "Product": [     "unitOfMeasure"   ],   "Customer": [     "Service"   ] },



baseCurrency

Specifies the base currency for the Datamart if there is no step before this one to set it.

"baseCurrency": "EUR"



dsFieldsMapping

Tries to map the key field by fieldName and fieldValue in a specified Data Source (dsUniqueName) and then map the field to the main Data Source (sourceName) with the specified field (sourceFieldName). The result is that the field name in the main Data Source is renamed by the found field. If no field is found, the step tries to pair with key fields.

"dsFieldsMapping": [ { "sourceFieldName": "ProductId", "dynamicPath": { "dsUniqueName": "Product", "fieldName": "sourceField", "fieldValue": "sku" } } ],



Example



PlatformManager version 1.75.0