Hello !
From the metadata (Frontmatter / YAML) I want to display the scores of several users in a table with:
- one line by day
- one column by user
But I can’t find the solution to display the values in a single line
---
date: 2023-04-01
U4:
- USER1: 1
- USER2: 0.5
- USER3: 0.5
- USER4: 1
---
```dataview
table
date,
number(U4.USER1) AS USER1,
number(U4.USER2) AS USER2,
number(U4.USER3) AS USER3,
number(U4.USER4) AS USER4
where file.name = this.file.name
```
The result with this query is
I tested with GROUP BY and FLATTEN like this
```dataview
table
date, USER1, USER2, USER3, USER4
where file.name = this.file.name
GROUP BY ""
FLATTEN number(U4.USER1) as USER1
FLATTEN number(U4.USER2) as USER2
FLATTEN number(U4.USER3) as USER3
FLATTEN number(U4.USER4) as USER4
```
But the result is
Do you have an idea to display the values on a line (and without the bullets points)
Thanks
Try this:
```dataview
table
date,
filter(U4.USER1, (t) => t) AS USER1,
filter(U4.USER2, (t) => t) AS USER2,
filter(U4.USER3, (t) => t) AS USER3,
filter(U4.USER4, (t) => t) AS USER4
where file.name = this.file.name
```
1 Like
Thanks
I did not know the filters
I edited the frontmatter so that the values are in duration format
---
date: 2023-04-07
U4:
- USER1: 0,5 day
- USER2: 1 day
- USER3: 0.5 day
- USER4: 0 day
---
The result is
I want to add:
- a total column: sum of each user per day
- a total line: sum of days per user
- the total of total display the sum of days for all users
Is it possible to do these calculations in DQL?
I tested by combining sum and map functions without success
Using two tables:
```dataview
table
date,
filter(U4.USER1, (t) => t) AS USER1,
filter(U4.USER2, (t) => t) AS USER2,
filter(U4.USER3, (t) => t) AS USER3,
filter(U4.USER4, (t) => t) AS USER4,
sum(filter(U4.USER1, (t) => t) + filter(U4.USER2, (t) => t) + filter(U4.USER3, (t) => t) + filter(U4.USER4, (t) => t)) AS TOTAL
where U4
```
```dataview
table
sum(filter(sum(rows.U4.USER1), (t) => t)) AS USER1,
sum(filter(sum(rows.U4.USER2), (t) => t)) AS USER2,
sum(filter(sum(rows.U4.USER3), (t) => t)) AS USER3,
sum(filter(sum(rows.U4.USER4), (t) => t)) AS USER4,
sum(sum(filter(sum(rows.U4.USER1), (t) => t)) + sum(filter(sum(rows.U4.USER2), (t) => t)) + sum(filter(sum(rows.U4.USER3), (t) => t)) + sum(filter(sum(rows.U4.USER4), (t) => t))) AS TOTAL
where U4
group by total
```
Also 0,5 day
will not work. You must use 0.5 day
.
1 Like