Dataview - Split a tag with character and then Grouping first item of the array

What I’m trying to do

I have to deal with several clients on a weekly basis.
I’m tracking down all progress and work in tags, on an hourly basis.

And I’ve written a few dataview queries to extract what happened each week.

```dataview
TABLE dummy as "LAST WEEK"
FROM "0 Inbox/Calendar/Daily"
WHERE dummy != null
AND file.day.year = number(substring(string(this.file.name), 0, 4))
AND file.day.weekyear = number(substring(string(this.file.name), 6, 8)) - 1
SORT file.day
```
```dataview
TABLE dummy as "THIS WEEK"
FROM "0 Inbox/Calendar/Daily"
WHERE dummy != null
AND file.day.year = number(substring(string(this.file.name), 0, 4))
AND file.day.weekyear = number(substring(string(this.file.name), 6, 8))
SORT file.day
```

I thought of enhancing it, by grouping instead of by day by the customer (ABC, XYZ, etc) and adding an additional column at the end with the date when this happened.

The intent is then to have something similar to this:

But that instead of grouping by Date, shows a group with all ABC entries, and another with all WYZ entries, with an additional column at the end showing the this entry was made.

Things I have tried

I leveraged Brian Jenkins weekly note review for these queries, and then did some changes to them, to group them by date and sort them I followed several posts in this forum, but I can’t figure out a way to use Split and then group by the output of the split.

```dataview 
TABLE rows.work.split(field, "-") as WORK, date as ENTRY
FROM "0 Inbox/Calendar/Daily"
WHERE work != null
AND file.day.year = number(substring(string(this.file.name), 0, 4))
AND file.day.weekyear = number(substring(string(this.file.name), 6, 8))
GROUP BY rows.work[0] AS Customer
SORT Customer ASC
```

Because then I get that I cannot use array as a function:

Any hints on how to accomplish it?

PS: I’ll probably be using a different split character rather than “-”, which could be very common, but this was for the sake of asking the question.

//Continuing here, since I cannot edit the post anymore.

In essence, what I’m trying to get is something similar to this, but grouping by ABC and WYZ.

I also tried this:

```dataview
LIST rows.dummy
FROM "0 Inbox/Calendar/Daily"
WHERE dummy != null
AND file.day.year = number(substring(string(this.file.name), 0, 4))
AND file.day.weekyear = number(substring(string(this.file.name), 6, 8))
OR file.day.weekyear = number(substring(string(this.file.name), 6, 8)) - 1
GROUP BY dummy.split(field, "-") as ENGAGEMENTS
SORT ENGAGEMENTS[0] ASC
```

But I’m getting

I thought if I could split the content of each entry of “dummy” I’d be able to output…:

  • In the first column all dummy[0] = ABC, WYZ, etc entries
  • In the second column all dummy[1] = Lorem ipsum dolor sit amet entries
  • Last column, have a date for each sub-entry (Least relevant)

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