Dataview: Pick tags based on days of the week

Folks, need some help on how to make this happens

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 ?

thanks in advance

Any tips @holroy ? i know you are the king of dataview here

Tbh, i have a complex query on behind , would be better to put these tags on the “FROM” clause, if possible

Where or how do you want to use the query? Is it from a dashboard, in a template, in a running daily note (resembling a dashboard)?

And what do you want out of the query? Your use case is rather slim.

Based on the current information I’m thinking maybe using a dv.view() which includes/runs the query of that day.

i gonna use in daily note and add on that code

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,
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,
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

@holroy any tips would help, and if you still have doubts about use of case, let me know.
thanks in advance , and sorry for disturb

found a way

I’m glad you found a way that works for you.

Here is a variant, untested, which potentially counts ease other parts of your query. It should produce the same as the query you posted:

  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,
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 :wink:

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