This statement is not setting the inline field remaining to be the remaining days of that particular todo, which is easily assumed. It’s actually setting the inline field of remaining to be the actual query.
In some cases, this might work as you want it to, but in most cases it’ll not work. Especially if trying to use this value in another plugin or as base for some other stuff. In your case it’ll not work in a table on another page, as then the this.due will try to lookup the due field in the file where the query is being executed.
You need to do the calculation in the table itself, so try something like the following:
```dataview
TABLE Remaining
FROM #todo
FLATTEN due - date(today) as Remaining
SORT Remaining
```
(You might need to use date(due), but if it’s properly formatted, that shouldn’t be needed)
Update: Removed file. in front of the due variable
Oopps… I did make a typo there. I shouldn’t have written file.due. The variants to use should be either due for the due variable in n any file of your query (like you do in date(due), or this.due when you want the due date of the current file.
With that out of the way. Does it work with just due, and not date(due)? It should do so, if the date is properly formatted.