<< Click to Display Table of Contents >> Create Expression |
![]() ![]() ![]() |
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.
Select Create Expression by clicking theMore icon in the Metadata area as shown in the figure below.
Click More icon on a column header in the detail data page and choose "Create Expression" from the context menu.
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.
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.
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.