Aggregating numbers

From Semantic MediaWiki - Sandbox

Revision as of 23:02, 29 March 2017 by Kghbln (talk | contribs) (chg)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Storing values

{{#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

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

Result

Table
NameUsed to store strings of arbitrary length.ValueUsed for property values that contain any kind of number, integer, decimal, and floating point numbers.
first1
third1
second2
fourth2
Total

6

Count

4

Cookies help us deliver our services. By using our services, you agree to our use of cookies.