<< Click to Display Table of Contents >> Create Calculated Field |
In the editing interface of the data set, the user creates a new Calculated Field. The scope is the current data set. All dashboards that use the data set can use the Calculated Field. On the metadata area interface, right-click and select Create Calculated Field. By default, the selected column in the More menu is used as the Calculated Field function. You can input the function language to return the field content. The calculation type defaults to the basic function. After creation, the field would be put under the Dimension or Measure folder automatically. If you want to change the field type, you can move it to the Dimension node or the Measure node by drag-and-drop.
❖Editing interface
In the metadata area, users can create their own data segments, which exist only in the current data set and do not exist in other data sets of the same type. In the metadata area, click the More button after the field and select New Calculated Field to open the Calculated Field dialog box.
❖Detailed introduction
In the dialog box that opens, the user can enter a Calculated Field function in the blank area of the figure below to create a data field. When creating a data segment in a dataset, you can call various functions provided under the DateTime, Text, Math,Type conversion, Logic folders. For a detailed introduction to functions, see the Calculated Field Function List
[Name] Set the name of the data segment.
[Calculation type] Set whether to use Yonghong's Calculated Field function or SQL statement to create a Calculated Field
❖Application examples
If there is a sales data segment in the metadata area, as shown below.
When the user needs to add 1000 to each piece of data in the sales field, you can create a new field by creating a new Calculated Field. Assuming the name is sales2, just click the sales column, and then add +1000 to the back. The function content is col [ 'sales'] + 1000;
As shown below:
The sales2 field is generated under the measure node, as shown in the following figure.