Select the right data together

I have a table in which orders were entered. Now there are clients who have more than one order, how do I get them on one invoice?
I added a field to the table to select the entries I want to work with. It would be much nicer if I could summarize the entries using the same names and email addresses, for example. Can someone give me a tip on how to do this?

The Orders table should have a column included for Client. Ideally this is a Ref column that points to the proper row in the Clients table so that you can access all of the Client information within the context of the Order(s).

If you have that column then getting all the Order related to that single client is a matter of selecting the Order by that Client. Depending on exactly where in the app you need this expression will dictate how the expression is actually implemented.

But as an an example, let’s assume you are processing an invoice for a client. In some way the app will “know” which client you are processing (depends on your app). For the sake of this example lets say we are processing through a list of Client rows that has a [Client ID] column included. The expression COULD be something like this to get all of the Orders for the same client:

SELECT(Orders[Order ID], [Client] = [_THISROW].[Client ID])

[Client] is the column in the Order table that contains the “Pointer” to the Client row. Pointers are just the row key. The portion, [_THISROW].[Client ID], refers to the client row being processing and accessing the {Client ID} column - the client row key.

SELECT()

If you need more specific help, please provide more details about your specific implementation so we can help you better.

I hope this helps!

1 Like

Many Thanks. Ok, I’ll explain a little more..
We check the tombstones in cemeteries. We always plan our next week in advance and enter this in a table.
Form responses 2.
There I assigned about 25000 unique IDs in advance and we enter new places there. Complaints are assigned via this ID.
Now it is mostly the case that one place is responsible for several cemeteries and gets the bill for it. Now I’ve added a column based on your statement and entered the id of the “mother” there. As an example 5 cemeteries: (The column has the name “Erbschaft”)

I also have a column where I put an X if I want to create an invoice for this place. Which I want to create with bots. I also need the “query” for that

What are your questions?

1 Like

I would like to create a document with a bot where an invoice is created with these entries.
And I think I’m in the wrong place. I need a query in a template so that the places linked to it appear in a list.