LINKTOFILTEREDVIEW - Search information with related tables.

Hi community,

I am creating a prototype to search products, each product has a different variables associated (unlimited). I have saved the information in the MySQL database, the schema related with the search is:

alejandrovargas_0-1654124360358.png

In AppSheets one part of the form is that the user can select variables from a dropdown (it is working) and write the min and max values of the range. See the picture with the form:

alejandrovargas_1-1654124386931.png

I want to search the products that have the variables selected by the user. First of all, I trying to use the following formula to search the products that has the variable selected, it does not generate error, but it is not working because all products appears.  I am not sure if "select" function is correctly for these case:

LINKTOFILTEREDVIEW(
"productos",
IN(
[Related productos_variables],
SELECT(
productos[Related productos_variables],
[Related productos_variables] = LIST([_THISROW].[Variable1])
)
)
)

 

The columns of the productos contains the following list. The first one is the used for the relation with productos_variables table.

alejandrovargas_2-1654124417344.png

Thanks for your advice.

0 3 71
3 REPLIES 3

Steve
Platinum 4
Platinum 4

Please explain in plain language what your expression is supposed to do (indented for clarity):

LINKTOFILTEREDVIEW(
  "productos",
  IN(
    [Related productos_variables],
    SELECT(
      productos[Related productos_variables],
      [Related productos_variables] = LIST([_THISROW].[Variable1])
    )
  )
)

 

Steve thanks for the advice,  I made the change in the post.

I forgot to add the database query that execute an similar searches of what I would like in App Sheets.

SELECT producto.codigo, producto.nombre, variable.nombre, productoVariable.valorMin, productoVariable.valorMax 
FROM productos producto
inner join productos_variables productoVariable ON producto.codigo = productoVariable.codigoProducto
inner join variables variable ON productoVariable.codigoVariable = variable.codigo
where variable.codigo = 1

 

Top Labels in this Space