list problems

My application has two tables. The first table consists of a list of products with a unique ID and one column indicating which store they are in. The second table is for sale. It specifies the date, seller ID, and store ID. A third table, Sales Details, is related with this table. This table contains the product, quantity, price, and here I have a problem. When I want to select a product, a list of all products will drop down. And I need the drop-down list to contain the products of this particular store, which has already been selected in the second table. And these tables are connected through sales id. What formula and how should I use so that I can see only those products that are in the selected store?

Solved Solved
0 8 192
1 ACCEPTED SOLUTION

This all helps to clarify your structure and flow.  I believe your expression you supplied earlier was very close.  It appears all you needed was a [_THISROW] qualifier.

SELECT(Products[Product ID], [ShopID] = [_THISROW].[SaleID].[ShopID])

View solution in original post

8 REPLIES 8

A picture is worth a thousand words!  It would be best to include an image showing where in your app you are seeing an issue.

I will assume, since you mention dropdowns, that you are trying to fill out a Form View.  In that Form View you have a Store column and then a Products column.  You want the Products column to be be dependant on the selection of the Store.

This expression would be something like this:

SELECT(Products[Product ID], [Store] = [_THISROW].[Store])

This is the typical implementation of a dependant dropdown column.  There may be some tweaks needed depending on how you define the Products column.  For example, if it is a Ref column, i.e. pointer to the Products table, you will want to make sure that you have set the desired column as the Label column in the Products table to ensure the dropdown list shows a meaningful value rather than the Product ID.

Please ask if you have questions.

Thank you for responding.
Yes, I have tried that. But the problem is that the ShopID column is in another table. [_THISROW] not applicable

prob.jpg

pr1.jpgpr2.jpgpr3.jpg

I did this so that when selling, sellers do not have to enter the store ID and seller ID again and again within one day

 

Ok, but to do this "And I need the drop-down list to contain the products of this particular store,"  you must have something recorded somewhere that links the Products to the store.  I am not seeing anything in your data tables that provides that.

Edited: Actually I do now see that through your Sale Details  BUT  Sale Details implies products that are being sold based on orders made.  What if a Product hasn't been sold yet, say a new item in inventory, how does it get associated with the Shop ID?

 

pr01.jpg

 

pr05.jpg

"Products" table and products form

 

 

columns

pr06.jpg

This all helps to clarify your structure and flow.  I believe your expression you supplied earlier was very close.  It appears all you needed was a [_THISROW] qualifier.

SELECT(Products[Product ID], [ShopID] = [_THISROW].[SaleID].[ShopID])

Thanks. You are the best!👍😎👋💪🍾

Top Labels in this Space