Aggregating numbers

De Semantic MediaWiki - Sandbox

Refs: http://wikimedia.7.x6.nabble.com/SMW-Property-Ask-Same-property-multiple-times-on-same-page-tc5073446.html

Storing values[modifier | modifier le wikicode]

{{#subobject:
 |Is row={{#counter: example }} // make the subobject unique
 |Has page={{FULLPAGENAME}} // provide an identical reference
 |Has text=first // some text
 |Has number=1 // some number
}}



Querying values[modifier | modifier le wikicode]

{{#ask:
 [[Has page::{{FULLPAGENAME}}]]
 [[Has number::+]]
 |?Has text=Name
 |?Has number=Value
 |mainlabel=-
}}

Result[modifier | modifier le wikicode]

Table
NameValue
first1
third1
second2
fourth2
Total

6

Count

4

Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.