Page MenuHomePhabricator

New type for #ask queries: Total!
Closed, ResolvedPublic

Description

Author: mrandmrsmurphy

Description:
Instead of type=count it's type=total. This would attempt to add all the values of first solicited parameter. For example:
{{#ask: [[Category:Prime number]] [[Numerical value::<10]]

?Numerical value
type = total

}}
would return 17 (2+3+5+7) on a wiki with pages "Two" "Three" "Five" "Seven" which were all in the category:Prime_Numbers and had propery "Numerical value" equal to their value. Additional ?'s in the ask would be ignored. Lack of a value would return 0. Strings and other non-numerical values in the requested parameter would result in nonsensical returns.


Version: unspecified
Severity: enhancement

Details

Reference
bz14835

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:09 PM
bzimport set Reference to bz14835.

Re-assign to extension developer for triage/comments.

see also: http://www.nabble.com/Adding-a-%27sum%27-format-for-inline-queries-td20885326.html

Okay, I just talked to Markus, who said that 'sum' and any other math functions should go into Semantic Result Formats and that the general goal is to get all but the most basic formats (i.e. list, table, etc.) into SRF. And yes, 'average', 'min' and 'max' also make sense.

Nathan, if you have code for 'sum', could you please send it to me?

-Yaron

Output formats for sum, min, max, etc. have long been added to SRF now. Closing bug.