Template:TableUnnamedArgsConditionOffsetFooter

From Linux Web Expert

This is a demo template used in connection with demonstrating the template parameter allowing to add the #resultoffset variable to result format "Plainlist"Outputs results in a comma separated list, with additional outputs shown in parentheses. The output does not provide class attributes to HTML elements (default for queries without printout statements)..

Note that this example also uses the #expr parser function provided by extension ParserFunctions as well as the formatnum parser function provided by MediaWiki itself for the purpose of formatting the results.

Code

 ! style="text-align: right" | Average
 ! style="text-align: right" | {{formatnum: {{#expr: {{formatnum: {{#ask: {{{#querycondition}}} |?Population |format=average |offset={{{#resultoffset}}} }} |R }} round 0 }} }}
 ! style="text-align: right" | {{formatnum: {{#expr: {{formatnum: {{#ask: {{{#querycondition}}} |?Area |format=average |offset={{{#resultoffset}}} }} |R }} round 2 }} }} km²
 |-
 ! style="text-align: right" | Total
 ! style="text-align: right" | {{formatnum: {{#expr: {{formatnum: {{#ask: {{{#querycondition}}} |?Population |format=sum |offset={{{#resultoffset}}} }} |R }} round 0 }} }}
 ! style="text-align: right" | {{formatnum: {{#expr: {{formatnum: {{#ask: {{{#querycondition}}} |?Area |format=sum |offset={{{#resultoffset}}} }} |R }} round 2 }} }} km²
|}

See also