OK, since you didn't decide on any particular solution, here's an untested
rough outline.
<table>
<$list filter="""[criteria for whatever tiddlers should be listed]""">
<tr>
<td><$link/></td>
<td>{{!!myvalue}}</td>
<td>
<$button>
<$action-listops $tiddler=tempsum $field="selected"
$subfilter="""+[toggle<currentTiddler>]""" />
<$list filter="""[ [tempsum]get[selected]search<currentTiddler>]"""
emptyMessage=add > --- </$list>
</$button>
</td>
</tr>
</$list>
<tr>
<td style="text-align:right">SUM:</td>
<td>{{{ [[tempsum]get[selected]enlist-input[]get[myvalue]sum[]] }}} </td>
<td></td>
</tr>
</table>
It is probably buggy. For example, if it shows anything at all, test if it
gets the correct sum if several of the items have the same myvalue.
By the way, that button code will be greatly simplified/removed if we had
this <https://github.com/Jermolene/TiddlyWiki5/issues/5613> to show a
checkbox instead.
<:-)
On Monday, May 31, 2021 at 10:09:31 PM UTC+2 [email protected] wrote:
> For the time being, it is just the table, no sum total of weight or
> anything yet. I have not expressed myself well what I meant with
> "selected" but your guess is exactly what I wanted to say, i.e. selecting
> which gear to take by putting a checkmark next to it.
>
> As I said, for the moment there is nothing but the idea in my head. By the
> looks of it the table calculations might be helpful but I am all ears if I
> should try something else for some reason.
> http://tablecalcs.tiddlyspot.com
> By default, it does not cover my main incentive, namely summing up only
> the values in rows with an active checkmark.
>
> I'd be grateful for any suggestions
>
> On Monday, May 31, 2021 at 9:19:25 PM UTC+2 Mat wrote:
>
>> How is your table implemented? Calculating the sum of a column is not a
>> standard feature in TW, so maybe you're using some plugin?
>>
>> But (probably) regardless, it should be doable, yes. One idea would be a
>> column at extreme left or right with checkboxes. Instead of selecting, you
>> check the relevant rows, and there is a sum calculated from this. It could
>> work so that the selected titles are added to some list, and the sum is
>> calculated by extracing and summing up the weight from all the listed items.
>>
>> <:-)
>>
>> On Monday, May 31, 2021 at 10:43:34 AM UTC+2 [email protected] wrote:
>>
>>> Hi
>>> perhaps someone can help me with this. I have a table in Tiddlywiki with
>>> the weight and dimensions of pieces of equipment that I need to take with
>>> me on a trip with tight baggage limits. As some of the items in that lists
>>> are alternatives, I do not need a sum of the entire column but rather the
>>> total weight of pieces that depend on item X but make no sense if item Y is
>>> taken instead.
>>>
>>> Is it possible to play through different scenarios by simply selecting
>>> and deselecting rows in a table that correspond to different solutions and
>>> have the sum update to reflect only the selected cells? I can manage the
>>> selection process manually, so defining sets of interdependent items is not
>>> needed here.
>>>
>>> Thank you
>>> Christoph
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/cabd0219-ef10-49b5-b880-bbd99498f7c4n%40googlegroups.com.