Databases Reference
In-Depth Information
•
The variable name begins with an e
: This is for administration purposes
mainly. Having a consistent naming convention helps you, as the developer,
as well as any other third-party, to easily identify the purpose of any given
variable. We commonly use the following prefixes when naming variables:
°
eVariableName
: When the purpose of the variable is to serve as an
expression definition
°
vVariableName
: When the purpose of the variable is to store a
v
alue,
whether static or calculated
The Expression Overview window in action
Of course, creating variables for often-used expressions requires knowing which
expressions will be used often. This is not always known beforehand. Fortunately,
as we have seen earlier, we can use the
Expression Overview
window to find and
replace expressions in a document. Let's see how this approach works by swapping
the
Performed vs Scheduled
KPI with a variable:
1.
Select
Settings
|
Variable Overview
from the menu, or click
Ctrl
+
Alt
+
V
,
to open the
Variable Overview
window.
2.
Click on
Add
, enter
ePerformedvsScheduled
in the
Variable Name
input
box, and click on
OK
.
3.
Highlight the
ePerformedVsScheduled
variable and enter the following in
the
Definition
input box:
(Sum([# Departures Performed]) / Sum([# Departures Scheduled]))
4. In the
Comment
box, enter
Ratio between scheduled and performed
flights
.
5. Click on
OK
to close the
Variable Overview
window.
6. Open the
Expression Overview
window by selecting
Settings
|
Expression
Overview
from the menu, or by pressing
Ctrl
+
Alt
+
E
.
7. Be sure to mark all different expression types from the filtering controls in
the window.
8. Click on the
Find/Replace
button.
9. Enter
Sum([# Departures Performed]) / Sum([# Departures
Scheduled])
in the
Find What
input box.
10. Enter the following in the
Replace With
input box:
$(ePerformedVsScheduled)
11. Disable the
Case Sensitive
checkbox and click on
Replace All
.
12. Click on
Close
to close the
Find/Replace
dialog.