How can I log my bike trip distances such that it shows me the total automatically? See below for what I do currently

I have a fixed distance I travel daily with my bike daily to/from work…
I am keeping a log of how many trips I have made this year and I would like to see the total KMS I rode so far. Since each trip has a fixed distance… I was wondering if we can extract a block entry (where the number of trips is mentioned) using queries and then feeding it to a javascript like the one below that I currently use.

const work = 3*16;
const total = work ;
logseq.api.show_msg(`Total KMS = ${total}`, "info");

I have added a click button that executes and shows me the kilometers as a floating message. I used this topic for this idea.

Can this be done in a dynamic way such that it automatically extracts the number of trips?

Also maybe to add the non standard trip distances that I log.

Any help is appreciated :slight_smile: