Looking for best practice for "task and time" tracking with obsidian

You could try something like the following:


- [project:: Something] (timespent:: 0.5h)
	-  kasdjadklajsd

- [project:: Different] (timespent:: 25 min) 
	- qweqweqweqwe

- [project:: Something] (timespent:: 1h 15min) 
	- iuozuioizouzio

## Queried version

```dataview
TABLE WITHOUT ID item.project as Project,
  item.timespent.minutes as Timespent, 
  item.children.text as Comments
WHERE file = this.file
FLATTEN file.lists as item
WHERE !item.parent
```

Total workload: `= round(sum(filter(this.file.lists, (l) => l.timespent).timespent).hours, 2) `h

If this is kept in a note of its own it should display something like (with local names instead of Norwegian :stuck_out_tongue: ):

Here I’ve done the total calculation outside of the table in a separate inline query focusing on the current file.

Similar queries can also be built over multiple files.

There are a few main points I would like to make though:

  • To make dataview pick up the information as fields you need to use syntax like above with double colons
  • Fields are connected either to the page, or to a list/task context. To be able to keep the project and timespent together you need to have them in a list context. Otherwise they’re all collated into two (or more) separate lists of the project and timespent (and comment) .
  • If you note the timespent as duration, it’s a lot easier to sum them up later on, and you can use durationformat() or similar measures to make it look pretty

This forum also holds various ways to do the summation of a column within the table (or as a postprocessing of the table).

1 Like