Inline fields challenge

Hi. On my daily note I have

Win:: [[Mark]] created spreadsheet X

I also have many Win:: inline fields on that page

Then I want to create a dataview on the [[Mark]] pages which only shows wins with [[Mark]] in it.

I have done the following…

table Win, file.mtime as "Modified"
from [[Mark Muller (team)]]
where contains("Win","")
sort file.mtime DESC

but that shows every win on a daily page mentioning Mark, I just want the Wins that mention mark on the same line.

I have also tried…

table Win, file.mtime as "Modified"
from [[Mark Muller (team)|Mark]]
where win = this.file.link
sort file.mtime DESC

And also got no results

I’m grateful for your help.

Given that you’ve got multiple Win, and you want to check something against each and every one of them, you need to FLATTEN the list first.

So given this base data and query:

Win:: [[Mark]] created spreadsheet X

I also have many [Win:: inline fields on that page]
Win:: Not a win

```dataview
TABLE aWin, file.mtime as "Modified"
WHERE this.file.name = file.name
FLATTEN Win as aWin
WHERE contains(aWin, "[[Mark]]")
```

I got this result:

Don’t matter the first WHERE clause, as I use that to limit my test to this file. The important bit is the FLATTEN Win as aWin, which allows for every list item in that list to referenced as aWin. Which then is used both in as a column, and in the last WHERE clause to check if it contains the [[Mark]] reference.

2 Likes

Thank you!!! I struggled with this for sooooo long… you are a genius.
Well, actually I’m a novice :upside_down_face:
I have learnt a lot about dataview, but have not grasped the FLATTEN concept. Where might be the place to learn it from a beginner point of view?

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