Creating a virtual measure

You create a virtual measure in an existing virtual measure dimension. After creating the virtual measure, you associate source measures with the virtual measure.

Creating a virtual measure - Quantity

The virtual_measure command creates a virtual measure called Quantity. The identifier contained in the response is used in subsequent commands to refer to the virtual measure dimension.

Input JSON data
{
  "parent":"<vMeasureDimensionId>",
  "dataFormat":"<formatGroup><numberFormat formatType=\"numberFormat\" 
      groupDelimiter=\",\" useGrouping=\"true\"/></formatGroup>",
  "name":"Quantity",
  "mergeOperator":"sum"
  "visible":"true",
}
  
Output JSON data
{
  "id":"<vMeasureIdQuantity>"
}
  

Adding a source dimension

The parent model contains a source measure with ids of <measureIdSalesQuantity> in the SalesMDSource source measure dimension.

The virtual_source command associates the source measure to the virtual cube. The parent measure dimension of the source measure is identified by its virtual source id. The identifier contained in the response is used in subsequent commands to refer to the source measure dimension.

Input JSON data
{
  "parent":"<vMeasureIdQuantity>",
  "name":"Quantity"
  "sourceObject":"<measureIdSalesQuantity>",
  "sourceParent":"<vDimensionMeasureSourceSales>",
}
  
Output JSON data
{
  "id":"<vMeasureSourceQuantity>"
}
  

Setting the Quantity virtual measure as the default virtual measure

The virtual_measure_dimension command is used to set the Quantity virtual measure as the default virtual measure for the Measures virtual measure dimension.

The HTTP request header X-HTTP-Method-Override: PUT is used for this action and the HTTP path for the request is

http://<server>:<dispatcher_port>/p2pd/servlet/dispatch/FmCommand
/virtual_measure_dimension/<vMeasureDimensionId>
Input JSON data
{
  "defaultVirtualMeasure": "<vMeasureIdQuantity>"
}
  
Output JSON data
{
  
}