Examples/Queries/Aggregating numbers

From semantic-mediawiki.org
Jump to: navigation, search
Examples/QueriesExamples/Queries/Aggregating numbers

math format, subobject query, aggregating numbers, sum

Sum for page embedded numbers

1, 1, 2, 4

{{#ask: [[{{PAGENAME}}]][[Has number::+]]
 |?Has number
 |format=sum
}}
 Has number
Examples/Queries/Aggregating numbers1
2
4

Total: 7

Sum for subobject embedded numbers

{{#ask: [[Has example::aggregating numbers]][[Has number::+]]
 |?Has number
}}
 Has number
Examples/Queries/Aggregating numbers#five4
Examples/Queries/Aggregating numbers#one1
Examples/Queries/Aggregating numbers#two1
Examples/Queries/Aggregating numbers#three1
Examples/Queries/Aggregating numbers#four2

Total: 9

See also