<< Click to Display Table of Contents >> Create Calculated Field |
![]() ![]() ![]() |
•Definition
"Create Calculated Field" refers to a convenient function for customers to add a new field in the product through SQL syntax on the basis of the original data column without modifying the original data.
•Classification
Calculated Field can be subdivided into: "Detail expression", "Dimension expression", "Aggregate expression" and "LOD expression"
•Scope
Create Calculated Field in "Create Dashboard": visible to the current dashboard, effective only for the current dashboard
Create Calculated Field in "Create Data Set": the Calculated Field can be used by the current Data Set and all dashboards using the Data Set
•Create Calculated Field
The product unifies the previous versions of "new detail expression, new dimension expression, new expression, new aggregate expression" into "Create Calculated Field", as shown in the figure:
When the user selects Create Calculated Field, a dialog box opens, as shown in the following figure.
[Name] Set the name of the data segment. Field name cannot be duplicated.
[Calculation type] Set whether to use "Basic function" or "SQL" statement to create a Calculated Field
[Function] This area lists the supported functions. Refer to 《Calculated Field Function》 for details of function usage
➢Example 1
As shown in the figure, the data column "market" already exists. We can add the text "Market" after each type by Create Calculated Field: col ['sales'] + " Market" :
The effect of the new field "market_type" is shown in the figure:
➢Example 2
As shown in the figure, given the "sales" and "profit" data, we can calculate the "cost" by Create Calculated Field: col ['sales'] + col [profit']:
The effect of the new field "cost" is shown in the figure:
➢Example 3
As shown in the figure, given the "sales" and "profit" data of each market, we can calculate the proportion between profit and sales by Create Calculated Field: sum (Col ['profit '] / sum (Col ['sales']) :
The effect of the new field "proportion of profit sales" is shown in the figure:
•Others
When the user needs to edit, rename, and remove the data field after creating it, the user can select this data segment and right-click to select the corresponding tab.