You can build expressions in the Field, Criteria, and Or cells in the grid within the Conditions section in the Design workspace. This topic includes formatting tips for creating expressions in each of those cells.
When you access the Expression Builder window from the Field cell, the Advanced tab is selected by default, and the Simple tab is disabled. You can construct an expression on the Field cell to reformat the results that are returned by the query.
For example, suppose that you want to display an installation date in two formats: the stored format and a modified format. In this case, you would add the Installation Date field to the query twice. The first would return the stored value, and the second could contain a Date function in the Field cell to indicate how you want the date to appear in the results.
If you add an expression to the Field cell, you must enter the exact syntax that is required in order to run the query. GE Digital APM will not reformat any text that you enter in the Expression Builder window for a Field cell.
When you access the Expression Builder window from the Criteria cell, the Simple tab is selected by default, but the Advanced tab is enabled. You can construct an expression in the Criteria cell to limit the results that are returned by the query.
Note: Anything you add to the Criteria cell will have the text WHERE or HAVING appended in front of the expression in the SQL code. WHERE and HAVING do not appear in the grid in the Conditions section.
For example, suppose that you want to return only those pieces of equipment manufactured by GOULDS. In this case, you would add the Manufacturer field to the query. You can then construct an expression in the Criteria cell using either the Simple or Advanced section.
If you access the SQL workspace, you will see the following code:
SELECT [MI_EQUIP000].[MI_EQUIP000_MFR_C] "Manufacturer"
FROM [MI EQUIP000]
WHERE [MI EQUIP000].[MI EQUIP000 MFR C] = 'GOULDS'
The expression WHERE [MI EQUIP000].[MI EQUIP000 MFR C] = 'GOULDS' is inserted automatically into the WHERE clause at the end of the SQL code.
Note: When you construct an expression in the Criteria cell, you can enter the exact syntax that is required to run the query, or you can enter something that is close to the required syntax, and then let the GE Digital APM system reformat it automatically.
Constructing an expression in the Simple section
In the Simple section of the Expression Builder window, you could use the options to construct an expression that looks something like the following image:
Constructing an expression in the Advanced section
In the Advanced section of the Expression Builder window, you could construct an expression that looks something like the following code:
('GOULDS')
While this text alone does not constitute an entire expression, GE Digital APM interprets the data in the remaining cells to construct a valid expression. The equal (=) operator is understood, and the Field and Table cells indicate the locations from which you want to retrieve data.
When you access the Expression Builder window from the Or cell, the Simple tab is selected by default, but the Advanced tab is enabled. You can construct an expression in the Or cell to limit the results that are returned by the query.
Note: Anything you add to the Or cell will have the text WHERE or HAVING appended in front of the expression in the SQL code. WHERE and HAVING do not appear in the grid in the Conditions section.
For example, suppose you want to return only those pieces of equipment manufactured by JENSEN or WESTERN SUPPLY. In this case, you would add the Manufacturer field to the query. You can then construct an expression in the Or cell using either the Simple or Advanced section.
If you access the SQL workspace, you will see the following code:
SELECT [MI_EQUIP000].[MI_EQUIP000_MFR_C] "Manufacturer"
FROM [MI EQUIP000]
WHERE ([MI EQUIP000].[MI EQUIP000 MFR C] = 'JENSEN'
OR [MI EQUIP000].[MI EQUIP000 MFR C] = 'WESTERN SUPPLY')
The expression [MI EQUIP000].[MI EQUIP000 MFR C] = 'JENSEN' OR [MI EQUIP000].[MI EQUIP000 MFR C] = 'WESTERN SUPPLY' is inserted automatically into the WHERE clause at the end of the SQL code.
Note: When you construct an expression in the Criteria cell, you can enter the exact syntax that is required to run the query, or you can enter something that is close to the required syntax, and then let the GE Digital APM system reformat it automatically.
Constructing an expression in the Simple section
In the Simple section of the Expression Builder window, you could use the options to construct an expression that looks something like that shown in the following image:
Constructing an expression in the Advanced section
In the Advanced section of the Expression Builder window for the Criteria cell, you could construct an expression that resembles the following code:
('JENSEN')
Then, you could construct an expression in the Advanced section of the Expression Builder window for the Or cell that resembles the following code:
('WESTERN SUPPLY')
While this text alone does not constitute an entire expression, GE Digital APM interprets the data in the remaining cells to construct a valid expression. The equal (=) operator is understood, and the Field and Table cells indicate the locations from which you want to retrieve data.
Copyright © 2018 General Electric Company. All rights reserved.