Databases Reference
In-Depth Information
The corresponding script that will be generated will be:
LOAD * INLINE [
Metric Name, eMetric
# of Flights, eDeparturesPerformed
Enplaned Passengers, eEnplanedPassengers
Air Time, eAirTime
];
The first column of the previous table holds the metric names, which the user will be
able to select from a listbox. The second column holds the corresponding expression
variable names, used to calculate any of the selected metric.
1.
Reload the script to add the new table to our data model.
2.
Then, we will create a new listbox based on the
Metric Name
field and place
it in the
Variables
sheet.
3.
Once the listbox is created, select one of its values and enter the listbox
properties window to enable the
Always One Selected Value
setting
from the
General
tab. This way, we ensure that we will have something
to calculate at all times.
The
Always One Selected Value
setting can only be applied
when there is one selected value in the listbox at the time the
properties window is opened. Otherwise, it will be grayed out.
Sometimes, this setting can be removed and might need to
be reapplied if the document is reloaded with no data in the
corresponding field (for example, in the case of a script error).
4.
We are now going to create a new chart, whose expression will be
dynamically changing based on the
Metric Name
selection. The settings of
the new chart are as follows:
° Select the
Pie Chart
option in the
Chart Type
section
° Enter the following expression into the
Window Title
field:
=[Metric Name] &' by Carrier Group'
° Disable the
Show Title in Chart
checkbox
° Set the dimension as
Carrier Group
° Set the following as the expression:
$($(=eMetric))
° From the
Presentation
window, enable the
Limit Legend
checkmark
and set it to
15