Create Expression

<< Click to Display Table of Contents >>

Current:  Create Data Set > Self-Service Data Set > Data Governance 

Create Expression

Previous pageReturn to chapter overviewNext page

Expression refers to creation of a new expression field in the data set editing interface. The action field is the current data set which can be used by all dashboards that use the data set. Click more icon of a column on the Metadata page or the column header of a field on the detail data page. Choose "Create Expression" from the context menu. In the displayed dialog, enter an expression name, select a data type, and edit the script to return the result. You cannot use aggregate function in a script. After the creation, put it under the dimension or measure node by dragging.

 

For example:

SQL&JS expression

Fields in the image below exist in Metadata area. The user needs to create a  field which is calculated by subtracting SALES from COGS field.

clip0346

Select Create Expression by clicking theMore icon in the Metadata area as shown in the figure below.

clip0347

Click More icon on a column header in the detail data page and choose "Create Expression" from the context menu.

clip0348

The default name of the expression as shown in the popup dialog is "Expression". Modify the name and data type and enter a script to calculate by means of SQL or JS. The following figure uses JS as an example.

clip0349

 

After click OK, Expression field will be generated in Metadata area.

If you use JS script while editing the data set refering to database, the performance of the data set will be affected. Real-time performance detection mechanism of Yonghong Z-Suite will identify the poor performance items. The user can also view all performance issues through clicking the [Performance Test] button.

clip0350

 

When a new Expression column is created, the column will be automatically selected. The vertical scroll bar will slide to the new column and select the new column.

The created expression can be renamed and deleted by clicking More button.

 

JS expression

Click More icon in the Multi-Dimensional Data Set metadata area and choose "Create Expression" from the context menu. Only script expression can be created as shown in the figure below.

MDX_EXP