JSON for Report Dimension
You can define dimensions for a report, and each of these dimensions has a set of attributes. You can define each dimension only one time in a sales organization.
Required Editions
Available in: Lightning Experience Available in: Enterprise and Unlimited Editions where Consumer Goods Cloud is enabled |
Report Product Dimension
Use product dimension meta to define the product hierarchy levels to be shown in a report. The levels and the sequence of products in a product dimension of a report metadata must be the same as the product mapping levels defined in custom metadata. In this example, Category is the highest product level and Product is the lowest level. If the product hierarchy levels in the product dimension and product metadata configuration doesn’t match, the report doesn’t return any results.
[
{"
name": "category",
"level": "Category",
"label": "Category"
},
{"
name": "subcategory",
"level": "SubCategory",
"label": "Sub Category"
},
{"
name": "brand",
"level": "Brand",
"label": "Brand"
},
{"
name": "flavor",
"level": "Flavor",
"label": "Flavor"
},
{"
name": "package",
"level": "Package",
"label": "Package"
},
{"
name": "product",
"level": "Product",
"label": "Product"
}]The attributes used in the JSON for product dimension are:
- name: Name of the product hierarchy level. This is the name that you must use in a report metadata.
- level: Product hierarchy levels as defined in TPM. For example, category, brand.
- label: Label of the product hierarchy level that is shown in a report.
Report Product Attribute Dimension
Show additional product attributes, such as Product ID, Product Code, or global trade item number (GTIN), in a real-time report. Ensure that you select Report Product Attribute Metadata as the usage when you create the report configuration.
[
{
"fieldsf$label": "cgcloud__product_code__c",
"fieldsf": "cgcloud__product_code__c",
"name": "productcode"
},
{
"fieldsf$label": "cgcloud__pack_size_unit__c",
"fieldsf": "cgcloud__pack_size_unit__c",
"name": "packsizeunit"
},
{
"fieldsf$label": "cgcloud__delivery_valid_from__c",
"fieldsf": "cgcloud__delivery_valid_from__c",
"name": "deliveryvalidfrom"
},
{
"fieldsf$label": "cgcloud__externalid__c",
"fieldsf": "cgcloud__externalid__c",
"name": "externalid"
}
]The attributes used in JSON for product attribute dimension are:
- name: Attribute name that’s shown in a report.
- fieldsf: Name of the field in Salesforce that the data is fetched from. Provide the namespace for the field. If you haven’t provided a value for the fielddb attribute, always enter a value for this attribute.
- fieldsf$label: Field in Salesforce that contains the label for the data field. Provide the namespace for the field. Always provide a value if you’ve provided a value for the fieldsf attribute.
Report Promotion Dimension
Use the promotion dimension to define the set of promotion KPIs that you want to appear in a report. You can configure from where the information for the KPI is fetched.
[
{"
name": "slogan",
"fieldsf": "cgcloud__Slogan__c",
"fieldsf$label": "cgcloud__Slogan__c"
},
{"
name": "type",
"fieldsf": "cgcloud__Promotion_Template__r.Id",
"fieldsf$label": "cgcloud__Promotion_Template__r.cgcloud__Description__c"
},
{"
name": "datefrom",
"fieldsf": "cgcloud__Date_From__c",
"fieldsf$label": "cgcloud__Date_From__c"
},
{"
name": "datethru",
"fieldsf": "cgcloud__Date_Thru__c",
"fieldsf$label": "cgcloud__Date_Thru__c"
},
{"
name": "instoredatefrom",
"fieldsf": "cgcloud__Placement_Date_From__c",
"fieldsf$label": "cgcloud__Placement_Date_From__c"
},
{"
name": "instoredatethru",
"fieldsf": "cgcloud__Placement_Date_Thru__c",
"fieldsf$label": "cgcloud__Placement_Date_Thru__c"
},
{"
name": "shipmentdatefrom",
"fieldsf": "cgcloud__Delivery_Date_From__c",
"fieldsf$label": "cgcloud__Delivery_Date_From__c"
},
{"
name": "shipmentdatethru",
"fieldsf": "cgcloud__Delivery_Date_Thru__c",
"fieldsf$label": "cgcloud__Delivery_Date_Thru__c"
},
{"
name": "id",
"fieldsf$label": "Name",
"fieldsf": "Id"
},
{"
name": "phase",
"fieldsf": "cgcloud__Phase__c",
"fielddb": "phase",
"fieldsf$label": "cgcloud__Phase__c",
"fielddb$label": "phase",
"sortenum": [
"Planning",
"Committed",
"Cancelled"
]
}]The attributes used in JSON for promotion dimension are:
- name: Attribute name that’s shown in a report.
- fielddb: Name of the Consumer Goods Cloud Processing Service (CGPS) field that the data is fetched from.
- fielddb$label: Field in CGPS that contains the label for the data field. Always provide a value if you’ve provided a value for the fielddb attribute.
- fieldsf: Name of the field in Salesforce that the data is fetched from. Provide the namespace for the field. If you haven’t provided a value for the fielddb attribute, always enter a value for this attribute.
- fieldsf$label: Field in Salesforce that contains the label for the data field. Provide the namespace for the field. Always provide a value if you’ve provided a value for the fieldsf attribute.
- sortenum: Order of data fields in a report. For example, to show the Planning Phase field before the values — Initial or Committed, the sortnum for the Planning Phase field can be 1 and the sortnum for values can be 2.
Report Payment Dimension
Use the payment dimension to define the set of payment KPIs that are shown in a report.
[
{"
fieldsf": "cgcloud__Payment_Type__c",
"fieldsf$label": "cgcloud__Payment_Type__c",
"name": "paymenttype"
},
{"
fieldsf$label": "cgcloud__Total_Tactic_Payout_Amount__c",
"fieldsf": "cgcloud__Total_Tactic_Payout_Amount__c",
"name": "totalpayout"
},
{"
fieldsf$label": "cgcloud__Payment_Amount__c",
"fieldsf": "cgcloud__Payment_Amount__c",
"name": "amount"
},
{"
fieldsf": "cgcloud__Payment_Status__c",
"fieldsf$label": "cgcloud__Payment_Status__c",
"name": "paymentstatus"
},
{"
fieldsf": "Id",
"fieldsf$label": "Name",
"name": "id"
}]Report Tactic Dimension
In payment reports, you can add attributes from the Tactic Product Condition object. You can’t use these attributes for grouping or sorting.
[
{"
name": "status",
"fieldsf": "cgcloud__Status__c",
"fieldsf$label": "cgcloud__Status__c",
},
{"
name": "value",
"fieldsf": "cgcloud__Value__c",
"fieldsf$label": "cgcloud__Value__c"
}]You can maintain additional settings for each attribute of a dimension.
- label: To define the label of the attribute.
- sort: To define the sort order of attributes within the dimension.
- datatype: To define the date columns as datetime. The datatype setting shows dates in locale format in your reports.
"promotiondimension": [
{
"name": "phase",
"label": "Promo Phase"
"sort": 2 // second sort criteria for details
},
{
"name": "datefrom",
"datatype": "datetime",
"label": "Date From",
"sort": 1 // first sort criteria for details
},
{
"name": "datethru",
"datatype": "datetime",
"label": "Date Thru"
}
]
The rows are first sorted by grouping attributes of the dimension. Within each group, rows are sorted by the sort value that you defined in the dimension attribute. If you don't provide a sort column for a dimension, the rows are sorted by the column ID of the dimension.
The labels that you specify in the attributes are used as labels for the columns in a downloaded report. If you don't specify the label attribute of a column in the layout, the labels are also used by flatList configuration. If you don't provide a label, the downloaded report uses the technical name of the attribute, which is in the format: dimensionname.attributename.

