RETURN variable number of column

Hello, everyone,

I have the following problem: I have modeled different bills of material, each with a different number of sub-items. Now my question is, I want to output the BOM with all items on the lowest level, I have already solved that, but I want to know all names of the corresponding upper assembly. So...
(Assembly)-[has]-(Assembly)-[has]-(Product)
(assembly)-[has]-(product)
Now each assembly sometimes has 2 and sometimes 3 or more sub-assemblies and in the last place always the product.
I would like to have the return:
subassembly | subassembly (if any)... | subassembly (if any)... | Product

Maybe someone can help me. Thank you very much.
Greetings
Julian

Are you looking to output a String consisting of subassemblies separated by | characters with the Product as the last part of the string?

Or are you looking to output a fixed number of variables/columns with each corresponding to a subassembly (if it exists) with the Product as the last one? Or something else?

Hi,
yes i am looking for a String consisting of subassemblies separated by | characters with the Product as the last part of the string.

Hello @julian-hartmann :slight_smile:

We will need more details to write a query but I can give you some tips to make your query:

Regards,
Cobra