Chart Facts, Pivot Facts, Request
Creates a computed item and returns an object that represents the item.
This method enables you to specify the name, expression, and index for the computed item.
Calculated items created in the Chart section are facts and placed in the Y-Facts pane of the Chart Outliner.
The name is the computed item name that appears in the Y-Fact pane of the Chart or Pivot Outliner and the Chart legend.
The expression that you specify must be a valid Interactive Reporting Studio and that displays in the Computed Items dialog box.
The index determines the position of a computed item in a pane. For example, an index of two is the second item in the Y-Fact pane.
If you apply the AddComputedItem method to a Query Request object, use the BqDataType constant to confirm or change the data type of an item. This preserves the precision of a mixed-data type computations, or changes how data items are handled (e.g. interpreting numbers as strings).
Pay attention to data types when computing items in the Query section. In this case, computations are performed on the database server, and computed items may be handed to Interactive Reporting with an unanticipated data type. To ensure that data is handled correctly on server computations, set the data type when performing mixed-data type computations.
Chart: Expression.AddComputedItem(Name As String, Expression As String,[optional Index As Number]) PivotLabels: Expression.AddComputedItem(Name As String, Expression As String, [optional Index As Number]) As PivotLabel Requests: Expression.AddComputedItem(Name As String, Expression As String, Type As BqDataType) As Request
An expression that returns a Chart fact, Pivot fact or Query request object
This example shows how to create a computed column titled Double Sales, which doubles the amount in the Unit Sales column: