lets say, I have some books with different themes (subjects).
I want to count this books with the themes.
So, all occurrences of a value (theme) should be counted but i want to limit the counts of a dataview query (in this case values > 1)
Things I have tried
my code looks like this:
TABLE
length(rows.file.link) AS Num
WHERE type = "Book"
FLATTEN theme AS T
GROUP BY T
this works fine so far, but when I insert the line:
WHERE Num >1
after the GROUP BY command, there are no more entries in the output.
How do I have to set the “limiter” that limits the output counts to only values > 1 ?
Calculations done in the header definitions are not stored, so they’re not able to be used in other parts of the query, but if you move it into a FLATTEN statement they can be used. So try the following:
```dataview
TABLE Num
WHERE type = "Book"
FLATTEN theme AS T
GROUP BY T
FLATTEN length(rows.file.link) AS Num
WHERE Num > 1
```
It could be you should consider moving other parts of you query around, but moving it into FLATTEN statement preserves the value for use in other parts.