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.

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:

  • text
  • indicator

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:

  • horizontal-bullet
  • plusminus
  • vertical-plusminus
  • vertical-slider
  • racetrack
  • alert
  • rectangle
  • slope
  • slider
  • slider-light
  • text
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:

  • circle
  • square
  • triangle
justification

column "$(MEASURE_1)" type="text" {

justification "left"

}

For column type text, defines the justification. Options are:
  • left
  • right
  • center
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.

CSS Color Syntax to use
"#XXX" hex "XXX"
"#XXXXXX" hex "XXXXXX"
"skin:X" skin "X"
value of macro $(MACRO "X") as evaluated at render time macro "X"

"rgb(#,#,#)"

[0-255]

rgb # # #

"rgba(#,#,#,#)"

[last number, alpha, should be 0-1]

rgba # # # #
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:

  • ytdtd (year to date)
  • ytd (year to complete month)
  • qtd (quarter to date)
  • mtd (month to date)
  • wtd (week to date)
  • cy (complete year)
  • cq (complete quarter)
  • cm (complete month)
  • cw (complete week)
  • cd (complete day)
  • rm12 (rolling 12 months, also known as rolling year by month)
  • y (partial year)
  • fm (future months)
  • qv (a time range determined by the Time Range QuickView)

variation can be:

  • c (current)
  • p (previous)
  • py (previous year)
  • cvp (current versus previous)
  • cvpy (current versus previous year)
  • cvp-pct (current versus previous percent)
  • cvpy-pct (current versus previous year percent)
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:

  • period "< q or m>"—the length of time to cover.

    • q (quarter)
    • m (month)
  • period-number <#>—number of the period to choose; for example period "m" and period-number 3 would result in the time range March.
  • offset-period "<y>"—the period by which to offset the time range. Must be longer than or equal to the period. For 0 offset, choose y.

    • y (year)—for example 'offset by -2 years'
  • offset-number <#>—number of periods (see offset-period) by which to offset the time range. For no offset, use 0. Negative and positive numbers are permitted, but they might not be appropriate depending on the other settings.
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:

  • period "<y, q, m, w, or d>"—the length of time to cover

    • y (year)
    • q (quarter)
    • m (month)
    • w (week)
    • d (day)
  • number-of-periods <#>—a positive number of periods
  • offset-period "<y, q, m, w, or d>"—the period by which to offset the time range. Must be longer than or equal to the period. For 0 offset, choose "y".

    • "y" (year)—for example 'offset by -2 years'
    • "q" (quarter)—available when period is quarter, month, week, or day
    • "m" (month)—available when period is month, week, or day
    • "w" (week)—available when period is week or day
    • "d" (day)—available only when period is day
  • offset-number <#>—number of periods (see offset-period) by which to offset the time range. For no offset, use 0. Negative and positive numbers are permitted, but they might not be appropriate depending on the other settings.

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:

  • period "<y, q, m, or w>"—the length of time to cover

    • y (year)
    • q (quarter)
    • m (month)
    • w (week)
  • to-period "<q, m, or d>"—complete the phrase: "<period> to complete <to-period>"; for example period "y" and to-period "m" would result in the time range 'year to complete month.' The options "q" and "m" (quarter and month) are only available for a period of "y" (year). If period is quarter, month, or week, only "d" (day) can be used as the to-period.
  • offset-period "<y, q, m, or w>"—the period by which to offset the time range. Must be longer than or equal to the period. For 0 offset, choose "y".

    • "y" (year)—for example: 'offset by -2 years'
    • "q" (quarter)—available when period is quarter, month, week, or day, that is, not year
    • "m" (month)—available when period is month, week, or day
    • "w" (week)—available when period is week or day
  • offset-number <#>—number of periods (see offset-period) by which to offset the time range. For no offset, use 0. Negative and positive numbers are permitted, but they might not be appropriate depending on the other settings.
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.