Replies: 2 comments 1 reply
-
hmm, But that would mean, that the :map and :reduce are already complex filter run prefixes. If they could be interchanged imo it would be even more complex. I would suggest, that we add the solution Eric provided to the docs. So there will be 1 way to solve that problem. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Here's another, more generic example of use the
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In response to a question in talk: https://talk.tiddlywiki.org/t/how-to-get-the-sum-of-field-values-by-filtering-based-on-prefix-of-field-names/6199/28
It was asked how to calculate the sum of field values based on filed name for given tiddlers. @ericshulman provided a solution as below
Which works fine. BUT, I think this question lends itself to
reduce
operator. So theBoth solutions seem a little complex. BUT for
reduce
, if the input contains several values, it only takes the first value. For example, see below solution:The makesum here returns all values for all fields prefixed with
ct-
, BUT the:reduce
only takes the first value and adds it to accumulator.What do you think if we add a
flat
suffix toreduce
?I think @saqimtiaz was the developer behind the reduce operator.
Beta Was this translation helpful? Give feedback.
All reactions