Hello!

I hope you can help me with what looks like simple problem.
problem.JPG

Please note that I need only lines where loc1, loc2 or loc3 is set. (in reality I have 9 loc-s)

Thanks in advance!