I know it's a very basic question, but being a noob at this, I really can't figure it out!
It's the very classic case of a Sales Dashboard. I have a Google Sheets file with a Customers data and another table with their orders.
I'm simply trying to show all the orders associated to a customer.
I have tried with filter and map functions but maybe I didn't put them in the right places? Or maybe I can do that with the manual filters of the tables?
Without you sharing the schema of your Google Sheet, it's nearly impossible for anyone to help you towards a solution. Can you please create a Google Sheet in the exactly same structure as your real one, but with fake data?
You can use the Query JSON with SQL resource for this one.
You have two sheets:
Customers Data (1 Gsheet read resource)
Orders Data (1 Gsheet read resource)
Call the above ones and join them in Query JSON with SQL and use something like this query:
SELECT
cd.name,
od.item_name,
od.item_price,
od.item_quantity
FROM {{ customerData.data }} cd
JOIN {{ orderData.data }} od ON cd.id = od.customer_id
WHERE cd.id = {{ select1.value }}
Reach out if you still have trouble implementing this one.
Oh, wait! @jocen
it worked! I made a small variation:
SELECT
cd.name,
od.item_name,
od.item_price,
od.item_quantity
FROM {{ customerData.data }} cd
JOIN {{ orderData.data }} od ON cd.id = od.customer_id
WHERE cd.id = **{{cd.selectedRow.data.custid}}**