Compare one list to another

I have these lists
image

I want to check the data in the right against the one on the left so I get the output:

false
false << these 3 false for the empty list checked against 1 2 3
false

true
true << these 3 true for the 1 2 3 checked against 1 2 3
true

true
false << this output for 1 and 3 checked against 1 2 3
true

true << this output for 2 checked against 2

I posted here: How do I add nulls to this list? but after some helpful posts I’ve realised I was asking the wrong question.

It’s important to keep the three lists in 0 list and the 1 list in 1 list.

Help!

How are you getting the list on the right? There may be a way to get that data in the format you’re looking for rather than checking it against another list.

First I’ve divided the sheets into series then taken the sheet revisions.

The List.OfRepeatedItem is done pretty much the same way but I filtered out duplicates first.

The idea is that I’m going to put this into excel - the 20 series on one sheet and the 68 series on another. I don’t want all dates on all sheets. I just want the ones pertinent to that series.

I’m still not sure why you need to compare the sheet revisions to the list of all available revisions. Is the goal to have Excel list the unique sheets, revisions, and dates in a series? Or is each sheet going to list all of its revisions and dates separately?

image

The goal is to get the output like that with different series on different tabs in excel.

So the idea is if I can get (for drawing 3) true false true…
Then I get a blank in the middle column and I can start at A on the left.

Will you always start at A and progress for the number of revisions in that series or is that just a placeholder? The reason I ask is that both series in your example start at A but the dates don’t match. Is it an option to show all revisions in excel and still only mark the ones for that series or do you have to limit yourself to only the ones in that revision?

The first issue will always be A (like on the Revit drawing sheet) but A isn’t necessarily in the first column. It just happens to be on all of the above.
Drawing 1 could be issued on a new date and then the first time it’s issued it would have ‘A’ in that column against it’s name.

(Excuse my awful scribble)

The sheet should only show the ones for that revision (otherwise there could potentially be dozens of blank columns on some pages).

Gotcha. This all helps.

1 Like

I was trying to do this without resorting to python, but a lot of the issues you’re running into are because of your list structure. Most nodes aren’t meant to work this way within specific levels of multi-level sublists. The empty list doesn’t help either.

Hopefully this will get you started.

sheet_revisions = IN[0]
series_revisions = IN[1]
out = []

for sheets,series in zip(sheet_revisions,series_revisions):
	series_out = []
	for sheet in sheets:
		sheet_out = []
		for revision in series:
			sheet_out.append(revision in sheet)
		series_out.append(sheet_out)
	out.append(series_out)

OUT = out
1 Like

Oh wow!!! Thank you so much!

I really want to learn a bit of python now!

Even knowing the basics can be extremely helpful in handing awkward list structures like this.

I need to learn a bit more dynamo first I reckon.