DataviewJS Snippet Showcase

Hi there! Is it possible to group by a column on a already grouped query?

I have this code:

dataviewjs  
let pages = dv.pages('#Cainita') .where(p => !p.file.name.includes("Template"))

let groups = pages.groupBy(p => p.residencia);

for (let group of groups){
	dv.header(2, group.key);
	dv.table(["Clan", "Cainita", "Generacion", "Status"],
		group.rows
			.sort(b => b.clan, 'asc')
			.map(b => [b.clan, b.file.link, b.generacion, b.status])
			
	)
}

which gives me this:

That is pretty ok for my zero knowledge of JS… but I would really like to have the rows on each “table” group also by “Clan”.
Something more like this, where there is only one row for each different Clan:

After hours of looking and trial and error I am about to gave up, so I’m looking for some help here first! :raised_hands:.

Thanks!

3 Likes