Measures Component Tags
Use the following tags to define a measures component for a stamp portlet.
Measures Component Tags
Tag | Example | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
measures |
measures { dimensions { dimension "Created Date" dimension "Created Year" } column "Volume" type="indicator" { label "Vol." display-type "alert" shape "circle" } } |
Defines the block for a measures component. The block and possible attributes: measures { dimensions { <first dimension> <second dimension> ... } <first column> <second column> ... <click actions list (optional)> } |
||||||||||||||
Optional attributes: | ||||||||||||||||
dimension | dimension "Year Created" |
Indicates the dimension name. Could also be specified as: dimension "$(DIMENSION_1)" to indicate the first user-chosen dimension or dimension "$(DIMENSION_2)" to indicate the second dimension, and so on. TIP: The order of the dimensions is the order in which to dive to create the initial window. |
||||||||||||||
num-items |
num-items 10 | Indicates the integer number of rows to which to limit the measures table. | ||||||||||||||
show-others | show-others | When used with num-items, groups the rest of the items into an others group. | ||||||||||||||
hide-nulls | hide-nulls | Hides rows that contain only null values. | ||||||||||||||
filter | filter "<filter expression>" context="summary" |
Defines an expression for a filter and the context—use summary for a window-level filter or record for a dive-level filter. Two functions are available: mf_value refers to a Measure Factory measure, with options to include date roll up or a time series. ![]() Columns not already included in the portlet can be referred to in an mf_value function. They will be automatically added to the dive and can be filtered on. This takes one to six arguments. The first argument is the measure name. If only one argument is provided and that measure is only referred to once in the corresponding portlet, DivePort uses that measure plus whatever roll up or variation is present in the portlet. If two arguments are provided, the second argument is used as the date-rollup-variation (such as c or p). If three arguments are provided, the second and third arguments are respectively used as the range and variation for a basic time-series. If four or more arguments are provided, they are used an advanced time series. The format is: mf_value(meas_name : string, time_series_type : string, period : string, adv_arg : integer or string, offset_period : string, offset_number: integer) value_by_id can be used if value tags have an optional id attribute that is assigned a string. The filter function can use value_by_id("id_string") to refer to columns within the same stamp component. The context of the filter must be set to "summary" because measure factory columns only exist in the summary window. |
||||||||||||||
show-totals | show-totals | Displays the totals row. | ||||||||||||||
hide-odd-row-coloring | hide-odd-row-coloring | Removes row shadings. | ||||||||||||||
sort-by |
sort-by "Total Admissions" { time-series { range "rm12" variation "c" } } sort-by "$(MEASURE_1)" { aux-measure "Target" } |
Allows sorting of the table based on a value. The value should be one that is already used as a column in the component. sort-by "<data column name>" or sort-by "<data column name>" { aux-measure "<aux measure name>" } The following two tags can be added as children (just as aux-measure is a child tag) to further specify the value: time-series { ... } Or, for components with rolled-up date dimensions: date-rollup-variation "<variation code>" (See Chart Component Tags.) NOTE: The sort-by and sort-by-column attributes are mutually exclusive. |
||||||||||||||
sort-by-column |
column "$(DIMENSION_1)" column "$(MEASURE_1)" column "$(MEASURE_2)" sort-by-column 2 |
If you are not worried about changing your column order, it is better and less error-prone to specify the number of the column that you want to sort by. For example, "sort-by-column 2" sorts by the 2nd column in the measures component. This only works for non-dimension columns. The example given here sorts the table by $(MEASURE_1) because it is the 2nd column. To either the sort-by or sort-by-column tags, you can add direction="up" to switch the sort direction to up. If you use direction="down" or omit the direction attribute, the sort direction is down. Examples: sort-by "$(MEASURE_1)" direction="up" { aux-measure "Target" } sort-by-column 2 direction="down" |
||||||||||||||
Columns are defined as follows: | ||||||||||||||||
column |
column "Avg LOS" type="indicator" { display-type "alert" shape "circle" } |
Other measure columns can be added. The type options are:
The general structure for a measure column definition is: column <name> type="<type>" { aux-measure "<name>" label "<label for this column>" width <integer pixels> display-type "<indicator type>" } Details can be found in the following table entries. |
||||||||||||||
aux-measure | aux-measure "Avg LOS" |
Names an auxiliary measure to use for this column. This attribute is optional. If omitted, an ordinary measure value is used. NOTE: If aux-measure is used in a stamp template and a measure is specified that lacks that auxiliary measure in the factory configuration, the values for the auxiliary measure are all null (--) in the portal. |
||||||||||||||
label | label "Items to watch" | Provides a label for this column. This attribute is optional. | ||||||||||||||
width | width 100 | Specifies the width for the column in pixels. Must be an integer number. This attribute is optional. | ||||||||||||||
display-type | display-type "vertical-plusminus" |
Names the indicator type. Options are:
|
||||||||||||||
wrap-text |
wrap-text hanging-indent=true |
Controls the overflow behavior on text columns. The wrap-text tag is optional. It has an optional attribute, hanging-indent=true, which defaults to false if omitted. For example: measures { ... column "$(MEASURE_1)" { //wrap text with hanging indent ... width 100 wrap-text hanging-indent=true } column "$(MEASURE_2)" { //wrap text without hanging indent ... width 100 wrap-text } column "$(MEASURE_3)" { //ellipsis truncation (default when width is set) ... width 100 } column "$(MEASURE_4)" { //automatic column sizing (no truncation) ... //no width set } } |
||||||||||||||
The following attributes can be defined for columns of relevant types in the same manner as for Indicator components: | ||||||||||||||||
shape | shape "circle" |
For column type indicator, specifies the indicator shape for display type alert. Options are:
|
||||||||||||||
justification |
column "$(MEASURE_1)" type="text" { justification "left" } |
For column type text, defines the justification. Options are:
|
||||||||||||||
colors |
colors { hex "ffaa22" hex "B2B2B2" } colors { rgb 246 117 33 } |
Specifies any number of lines describing colors, in the order in which they are to be used. The options to define color can be mixed and matched.
|
||||||||||||||
scale-min | scale-min -100 | Defines the scale minimum with a number or macro. | ||||||||||||||
scale-max | scale-max 100 | Defines the scale maximum with a number or macro. | ||||||||||||||
time-series |
column "$(MEASURE_1)" type="text" { label "rolling 12 current" time-series { range "rm12" variation "c" } } |
Defines the measure value as a basic time series column. range can be:
variation can be:
|
||||||||||||||
absolute-time-series |
column "$(MEASURE_1)" type="text" { label "rolling 12 current" absolute-time-series { period "q" period-number 1 offset-period "y" offset-number -2 } ... } |
Defines the measure value as an absolute-time series column. The absolute-time-series block has four required child tags:
|
||||||||||||||
relative-time-series |
column "$(MEASURE_1)" type="text" { label "rolling 12 current" relative-time-series { period "y" number-of-periods 1 offset-period "y" offset-number -2 } ... } |
Defines the measure value as a relative-time series column. The relative-time-series block has four required child tags:
For example, period "y" and number-of-periods 5 and offset-number -1 and offset-period "y" gives 5 complete years ending with the year before the last complete year. |
||||||||||||||
to-date-time-series |
column "$(MEASURE_1)" type="text" { label "rolling 12 current" to-date-time-series { period "y" to-period "d" offset-period "y" offset-number -2 } ... } |
Defines the measure value as a to-date-time series column. The to-date-time-series block has four required child tags:
|
||||||||||||||
comparison-time-series |
value "Shipped Orders" { comparison-time-series { from { relative-time-series { number-of-periods 1 period "m" offset-period "m" offset-number -1 } } to { relative-time-series { number-of-periods 1 period "m" offset-period "m" offset-number 0 } } } |
A value attribute that defines the measure value as a comparison-time series column. A comparison-time-series takes two other (non-comparison) time series as its arguments and calculates the difference between them. NOTE: Typically, the from and to time series are the same type, but that is not a requirement. |
||||||||||||||
threshold |
threshold -5 threshold 5
threshold "$(MACRO $(CONCAT $(MEASURE_1) \"_threshold\"))" |
Defines a list of simple thresholds in order. You cannot mix-and-match threshold types: if one threshold is a constant (number), all the thresholds must be constants; if one is a macro string, they must all be macro strings. NOTE: The macro strings must evaluate to constants, not column names. This macro expression example sets a different threshold for each measure. |
||||||||||||||
threshold-value |
threshold-value "$(MEASURE_2)"
threshold-value "$(MEASURE_NAME)" { time-series { range "mtd" variation "p" } aux-measure "Target" } |
Defines measure-based thresholds, with time series or auxiliary measures or both. The measure can be a fixed name or a macro. |
See Stamp Component Tags for attributes common to all the component types used in a stamp.