Totalling the durations recorded in my table

I have managed to use a simple query to get a table will all the activities per client I record in my daily journal pages. The table includes a :time-tracked property with the recorded duration of each activity, in the format hh:mm:ss. I have the feeling I should be able to use query function to sum up these :time-tracked values, to get a sum total of the recorded time spent per client, but I can’t find any documentation what function to use to sum durations. Simple numbers work fine, by the way, I can ‘sum’ those. But time records don’t seem to be recognised.

I have the feeling @Aryan knows of some plugins that are able to do these calculations on query results.

@TookiTheGreat, could you please share the query you’ve written? A screenshot and/or the query code would be very useful. That’ll make it easier to help you and let others learn from your process.

This is my query (based on what we did in Friday’s session:

{{query (and (property client “Cycle to Accelerate”) (between [[01-07-2022]] [[31-07-2022]]))}}

One of the properties is :time-tracked, I would like to total that for this table.

I am using a time-tracking plugin at the moment (logseq-time-tracker-plugin), but that works only on children of a block, not (it seems) on query results.

Also, out of curiosity, can a simple query reference the name of the current page? That would simplify my query even further.

I mean, I could then have query looking for all blocks with the client property equalling the name of the current page? Or am I now venturing beyond what a simple query can accomplish?

Can you share a snippet/screenshot of that that property looks like in action?

Is it like this (where 60 is the amount of minutes)?:
time-tracked:: 60

Here is an entry on today’s journal page:

Catch up Christine & Bard
client:: [[Coaching Enterprise Architects]]
task:: Planning
date:: [[18-07-2022]]
creation-time:: 07:58
time-tracked:: 00:41:43

The time-tracked is set by the logseq-time-tracking plugin. The format is hh:mm:ss.

Yes, this is possible (although it’s not yet documented). You can use <%current page %> in your query.

This is based on the template variables that also seem to work in queries.

Don’t think there exists such a plugin yet :frowning:

I’m trying (property client <%current page%>) but not getting any results.

Correction: I get results for:

(property client <% current page %>)

This works as expected and finds all entries with the client name pointing to the page the query is on.

but not for:

(and (property client <% current page %>) (between [[01-07-2022]] [[31-07-2022]]))

which is somewhat strange, because this query does work with literals for the client name, but not with the <% current page %> variable. So the two parts work well when used separately, but not when put together. Mysterious?