Create a derived field for an R function (sample)
If you created an R function, you can now use it in the derived field. See the sample procedure below.
- Open the record to use a derived field based on the R function.
-
In the
Fields column, select
Add derived field.
The Expression Editor appears. See Expression editor.
-
On the left menu pane, expand
R functions and add the
required R function.
The R function is shown in the expression editor screen.
- data_frame is a list of arguments.
- The IntConstant an argument defined in the additional arguments.
-
Modify the expression by typing the required parameters. In the
sample expression shown in the screen, the following parameters are added:
- IntConstant is set to 100.
- For IntValue, the data is pulled from dbo.Orders.ShipVia.
-
Click
OK.
R function when they are used in on-demand records:The following restrictions apply for the derived fields with an
- Only the R function from the top level record can be calculated.
- The field cannot be used in other derived fields or in data and time filters.
- The field cannot be used in related metrics.
- The field can have no aggregation or transformation.