How-to use the Choice Component with a Query Component

I have a Query Component picking up data from another table like this

which I need to display as a Choice Component like this

Week-Price

The query is working fine but I cannot find a way to get those 2 values together, having tried all sorts of things e.g. Split, Joined, Relations, Array etc.

The question is a bit like this one

but a bit different since here I need to display multiple values instead of a single value.

Any help would be greatly appreciated :).

Join them with a template column in the table you are querying. Then grab the Template out of the query for your choice component.

1 Like

Thank you, that’s working fine, just the other way around I was doing :).

Sorry, but now I have related question, for which I have created a simplified table:

Table

There are 7 Types in total, 36 Units and 49 Weeks making a total of 1.764 weeks for sale.

All possible weeks are inserted and the idea is that the users can only update the price in a Data Grid.

A filter by is not empty price is applied and all is working fine but I am getting all Weeks for sale for a selected Type but the clients wishes only to show the starting price of each Week, like this

Choice

Once again i tried queries, rollups etc but am always getting this kind of result

which is incorrect.

Is there any way to achieve this with Glide Tables?

Can you show what you are using as the source of the data grid, and how how your query is configured? Is the table that you used to build the choice component the same table you are trying to filter?

I created a dummy app for this, would it not be easier to share it with you?

PS Not sure if you normally do this, just asking.

I usually don’t hop into other people’s apps due to time constraints. I’m working at my day job, so I’m only in and out of the forum during the day.

Understood, so this are the columns of the Price Table:

This is the remainder:

This is the Query:

Just to Recap:

I need to get the minimum price of all Weeks of all Types order by Weeks.

This is the Sales Table where I need to show those minimum prices per week:

This is the Query:

Here I am trying to filter the other query by Type name eg. T1 etc.

Ok, just so I’m clear, this is to further filter down the choice component? I think my head was on filtering the data grid.

If I’m following along correctly, I think what I would do is create a template in the Price table joining just the Type and Week. Then create a query column linking the template to itself and sort by price or unit (whichever is correct). Then create a Single Value column to retrieve the first Unit/Price from the query.

With that setup, you should be able to go to your previous query used for the choice component and add a condition where the single value Unit/Price is equal to the row’s Unit/Price.

Hope that makes sense. The Single Value should always contain the lowest Unit/Price for the Type/Week combo.

2 Likes

Thanks, will give it a try and let you know later on.

1 Like