Access calculated dates in Tasklist

What I’m trying to do

I want to create a grouped and sorted list of all tasks in my vault, however I could not figure out, how I can tell the dataview task query


to take the results form the inline query, where the task is getting its due date. For recurring projects, I created a checklist in a note (“datum” is German and defined as Metafield in these notes; results of inline query are shown properly inside the note):

  • Task 1 :date:= date(this.datum) - dur(10 days)
  • Task 2 :date:= date(this.datum) - dur(14 days)
  • Task 3 :date:= date(this.datum) + dur(7 days)
  • Task 4 :date:= date(this.datum) + dur(20 days)

And these tasks don’t show up in the overview, because the due date is not set. Other tasks, where I set due dates manually are shown.

Things I have tried

I tried tasks instead of dataview. I checked this forum, youtube and dataview documentation, how one could view inline queries in other files. But I don’t get it.

This is my very first question in a tech forum. If I should provide more information, please tell me.

Thanks for your help!

A possible workaround would be to use Templater and do the date calculations once, when the file is created. This will do it for most of my usecases.

I would still be grateful for tips on how to solve the original question: how to use the results of inline queries in other files.

Thanks for your support

It’s very hard to do so, and you’re in most cases much better of setting the fixed date using something like Templater or similar.

You could change your inline query to something like:

`$="YOUR NOTE NAME").date + dv.func.dur("10 days")`

And it could possibly work displaying the date, but you’re still not setting the due date of a task using such a query. And even if you did [due:: ... ] with the query somehow you’ll still be at loss, since dataview stores the query itself, and not its result in the given field.

The only idea I’ve got other than using Templater which fixes the date to be relative to when you initiated the template, would be to add some marker to the field, and use a script next to the tasks themselves actually changing the file itself. I’m kind of thinking along the lines of:

- [ ] Task 1 %%dueOffset:: -10d%%
- [ ] Task 2 %%dueOffset:: -14d%%
- [ ] Task 3 %%dueOffset:: 7d%%
- [ ] Task 4 %%dueOffset:: 20d%%

Now a script could loop through all the tasks of the current file, see which had a %%dueOffset ... %% thingy, and add/change the due date of the task to match this.datum + dueOffset. If the same as it was before, then don’t change it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.