Count number of categories for each item in the list 1

Hi, I am trying to work find a script purpose of which is to count no. of Doors, Windows (List 2) against each item from List 1. Pictures being attached, please help.

I want the data i.e., Design Modification- Door Count 1, Window count 1,
Design Clarification- Door Count 1, Window count 1.
In the same way, for all 4 list items.

Project file.xlsx (12.5 KB)
Results visualize.dyn (162.0 KB)

@JacobSmall , @Nick_Boyts Hi, Can you please look into this query? Many thanks.

Hello and welcome…could your share your files…its almost impossible to know whats goin on here…

Thank you so much for your response. I have edited my post and included all the files in it.

1 Like

Hi @aneeqa_sikander and welcome, I do not know if this is what you are looking for, but it’s worth the shot, take a look at it:

Results visualize1.dyn (206.2 KB)

I think you need to separate the categories (indices 1 and 5) first and then combine those with the the first list.

a = List.RestOfItems(List.Clean(lst,false));
b = List.GetItemAtIndex(a<1>,6..5);
c = String.Split(List.FirstItem(b<1>),",");
d = String.AllIndicesOf(List.LastItem(b<1>)<1>,["Windows","Doors"],false);
e = ["Window Count : ","Door Count : "] + List.Count(d<1><2>)<1>;
f = List.Flatten(List.AddItemToFront(c<1><2>,e<1>),1);

The same with nodes …

Results visualize-1.dyn (34.5 KB)