What im trying to do:
based on the day of the week, like monday, i would like to pick statistics and physics tags to inject on the where clause
on thursday i would like to pick english and biology tags
so the question is how to put this on the Where clause ?
table tags as "Matéria" , choice(!T.completed, split(T.text, "_")[1], "\-") AS "Data" , split(T.text, "_")[0] as Tipo
from ""
FLATTEN file.tasks AS T
WHERE !T.completed and contains(T.text,this.file.name)
SORT tags
i use that code above to query all my notes tasks that are not completed (my tasks have that structure “[ ]1 _ [2023-06-24]”,[ ]3 _ [2023-06-24] … ), and pick the ones open that have the same day of the daily note (hence the contains(T.text,this.file.name))
would like to add the tags based on the day of the week on the “from” clause, to also make it more quicker (it take some time to run the query)
so i can only query certain tags per day of week
Here is a variant, untested, which potentially counts ease other parts of your query. It should produce the same as the query you posted:
```dataview
table
tags as "Matéria" ,
choice(!T.completed, P[1], "\-") AS "Data" ,
P[0] as Tipo
from ""
FLATTEN file.tasks AS T
FLATTEN array(split(T.text, "_")) as P
WHERE !T.completed and contains(T.text,this.file.name)
SORT tags
```
It’s not anything fancy, just storing the split so it’s easily available within P. Note the use of array() around the split to counter the FLATTEN