Help with query

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

Hi everybody
I have a note with a front matter property called group-by that I would like to use just to change the results of a query.
The dataview query in the same page should retrieve the value in this group-by property, this way:

TASK
GROUP BY this.group-by

Then, changing the value of the property the grouping result of the query should automatically update

Things I have tried

I tried as well with:

TASK
GROUP BY substring(this.group-by, 0)

Neither works

Anybody can give me a hand with this? Is it even possible with a simple dataview query?

Thanks in advance

What is the content of the group-by property? Is it the name of another property? If so, try using GROUP BY row[this.group-by]

Good night my friend. Right, I guess that’s an important information. The content is a text, with possible values identical to inline fields that each task might have.
This in order to group the wiery results by that very field content.
Let’s say a task can have for ex. an inline field such as [assignee:: Coleridge], another like [area:: HR]. I would like to query and group by assignees or areas, switching views just by changing the property in the page from group-by: assignee to group-by: area
Hope its clear. Thanks in any case

1 Like

I actually tried what you suggested and it looks like working perfectly. I would have never got to it. I ll do a couple tests more and confirm. Thanks so much for now!

1 Like

Thanks so much. It really works well. Just a detail if you could help me. Otherwise fine, its already good enough ad it is.
If I enter something as “assignee” or “area” or whatever in group-by its fine, but it doesn’t group if I enter some kind of file property like, for ex, file.name (which is the only one I would use, actually). Will there be a way around it?

I don’t think you’re able to use file.name using this method. I’ve not tested that variant.

Thank you very much anyways

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