'How To Display a static measure or column once in webdatarocks

I am creating a Classic layout using rows, column and measure. I want to add a static column( without doing any sum/average) as a last column. How can this be achieved?

Given the following configuration:

"rows": [
    {
        "uniqueName": "Type",
        "sort": "desc"
    },
    {
        "uniqueName": "SubCategory"
    }
],
"columns": [
    {
        "uniqueName": "Month"
    },
    {
        "uniqueName": "Measures"
    }
],
"measures": [
    {
        "uniqueName": "Amount",
        "aggregation": "sum",
        "format": "02fecc33bec74ccd9c8a0835259938f0"
    },
    {
        "uniqueName": "Budget",
        "formula": "min('BudgetAmount') ",
        "caption": "Budget"
    }
]

How can I display “Budget” column, which is static and will be the same, only once; whilst “Amount” is categorized by “Month”?

Can you please help me with an example incase it can be achieved by creating an additional instance of WebDataRocks to display the “Budget” measure with the desired configuration? I am not sure how this can be done.TIA



Solution 1:[1]

There is no built-in solution because, as a general rule, the pivot table approach does not allow adding fixed columns.

As a workaround, you can create the second component with following slice:

 slice: {
      rows: [{
          uniqueName: "Type",
          sort: "desc"
        },
        {
          uniqueName: "SubCategory"
        },
      ],
      columns: [{
        "uniqueName": "[Measures]"
      }],
      measures: [{
        uniqueName: "Budget",
        formula: "min('BudgetAmount') ",
        caption: "Budget",
      }]
    }
  }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 solja