Nested "for each row"

I have a table like the one below, with a column A with repeating values, and a column B with unique value associated at the value in the column A.
for each value of column A I must perform only one action (even if this appears in the column more than once), while for each value of column B it must repeat it as many times as there are values ​​in column B

I had thought of nesting two “For Each” loops, but the problem is that the action of column A must be repeated once while that of column B must repeat itself several times.
do you have any ideas?
thank you


If we got your requirements correctly we can do it with the help of a group by

we do building groups by the distinct sub-order values and
process the corresponding order values

find starter help here:
GroupBy_IntroSample_LINQ.xaml (10.4 KB)

similar approach without LINQ
GroupBy_IntroSample_DistinctAndFilter.xaml (11.6 KB)

@ppr you understand perfectly what i have to do, and your solution seems to works fine.
thank you

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