# Compare sublist values within a list

Ok, so I’ve got a list with sublist.
And I’m trying to compare the sublist values with each other to see if any values are different.

So the sublists within the red box get compared to one another.
The sublists in the green box get compared to one another.
And the sublists in the blue box get compared to one another.

What I’m looking to end up with is a list with true and false statements along these lines:

0 List
– 0 List
---- 0 True
---- 1 True
---- 2 False
---- 3 True
1 List
– 0 List
---- 0 True
---- 1 True
---- 2 True
---- 3 True
2 List
– 0 List
---- 0 True
---- 1 True
---- 2 False
---- 3 True

Any suggestions in how to achive this?
Thx!

Welcome to the community… check this post…

Heya,

Interesting one!

I think you might need to consider this a bit…

I’m not sure how you choose which is ‘true’? Unless you have a master list somewhere?

Here’s a quick go at it, it might be a bit wrong, but it hopefully helps with some useful nodes

Cheers,

Mark

compareSublists.dyn (3.9 KB)

``````l1 = a<1><2> == a<1><3>;
l2 = List.Transpose(List.Transpose(l1<1>)<1><2>);
l3 = List.AllTrue (l2<1><2><3>);``````

Perfect
Mucho Thanks

1 Like