In order to add additional Comparison Dimensions into the Comparison Dashboard, follow these steps:
Modify Line Item Logic AGR_FormulaBasedPricing
-
Introduce new Outputs on Line Item that will be used for the comparison (see How to Add New Outputs to Line Item):
-
These can be marked as Hidden, utilizing the Hidden_Group Result Group, if you do not want to show them to the user at the Line Item level.
-
Modify the Dashboard Logic AGR_DashboardScenarioComparison and ConstConfig in AGR_DashboardsLib
-
Navigate to the AGR_DashboardsLib/ConstConfig element and find the
SCENARIO_COMPARISON_DASHBOARD_CONFIGfield. -
In the
COMPARISON_MATRIXkey, underCOLUMNSkey, add new Comparison Dimensions (Columns) to display.-
Use the same structure as the other ones already defined
-
NAMEdefines the displayed name of the column -
FORMATdefines the formatting type of the value-
Remember to set the
FORMATto an appropriate one for the value returned from LI logic.
-
-
-
-
Navigate to
AGR_DashboardScenarioComparison. -
Find the
resultMatrixvariable that callsapi.newMatrix, add your new Columns there using the already defined variableresultMatrixColumns, for example:resultMatrixColumns.MY_NEW_COLUMN.NAME -
Do the same with the FORMAT definition below in the return statement of the element. Find
.withColumnFormatscall on thatresultMatrixvariable and add your new columnFORMATas a new Map entry, for example:
resultMatrixColumns.MY_NEW_COLUMN.NAME : resultMatrixColumns.MY_NEW_COLUMN.FORMAT] -
You can additionally add a column aggregation, if the newly added Column is a number. To do so, use
.withColumnAggregation(resultMatrixColumns.MY_NEW_COLUMN.NAME, "SUM")after the.withGroupBycall. -
Now let’s go back to the
getComparisonMatrixRowsmethod. This method reads the outputs and creates rows for the Comparison Matrix. Navigate inside it and find a return statement. -
Inside the return statement you have access to the outputs of a line item, they are stored in the same way as, for example, returned from
api.getCalculableLineItemCollection. To retrieve the value of an output for a given line item, you need to calldecodedOutputs.getAt("Name of the Output Element")?.result.decodedOutputsis the variable that should be used to read the output values. -
After the value has been read, it needs to be assigned to the row structure. This is what the
createLineItemRowmethod does. Add your read outputs as new method parameters and use them inside to define the row. Simply add new Map entry with the value, for example:resultMatrixColumns.MY_NEW_COLUMN.NAME : myReadOutputValue -
Verify the visibility of the newly added Column(s) on the Dashboard.