Skip to main content

Metrics

<metrics>
<metric
key="pct"
label="Percent"
valueFormat=".0%"
syntaxTemplate="pctin({entry},{entry2})"
/>
</metrics>

metric.key

Special, but explain why.

metric.label

Column name.

metric.valueFormat

A d3 format string. See d3 format.

metric.syntaxTemplate

The evaluator will replace keywords in brackets with attributes from entries or options that it crosses.

Recognized keywords and their non-intuitive mapping:

Template keywordAttribute replaced with
optionoption.value
entryentry.value
entry2entry.value2
entry3entry.value3
syntaxentry.syntax
filterentry.filter

Examples:

Standard percents

<metrics>
<metric
key="pct"
label="Percent"
valueFormat=".0%"
syntaxTemplate="pct({syntax})"/>
</metrics>
<entries>
<entry syntax="q7==25" label="..." />
</entries>

Filtered percents

<metrics>
<metric
key="pct"
label="Percent"
valueFormat=".0%"
syntaxTemplate="pct(filter({syntax},{filter}))"/>
</metrics>
<entries>
<entry syntax="q7==25" filter="qhid==2" label="..." />
</entries>

SR matrix percents

<metrics>
<metric
key="pct"
label="Percent"
valueFormat=".0%"
syntaxTemplate="pctin({entry},{option})"/>
</metrics>
<optionSets>
<optionSet name="options1" label="Options">
<option value="1" label="Boy"/>
<option value="2" label="Girl"/>
<option value="3" label="Bought for myself"/>
<option value="4" label="Family"/>
</optionSet>
</optionSets>
<entries>
<entry value="Q13r1" label="..." />
<entry value="Q13r2" label="..." />
<entry value="Q13r3" label="..." />
<entry value="Q13r4" label="..." />
<entry value="Q13r5" label="..." />
</entries>