Comparing two lists

Hi!

I'm working on a filter for dietary restrictions.

In one table I have the recipes and a column with a list of the allergens [Dieta].

In the filter table I have a EnumList with all the allergens [Filtro].

In a Form View I let the user select all their allergies to generate the [Filtro] list, so I can use a LINKTOFILTEREDVIEW.

I came with the following expression for the action:

LINKTOFILTEREDVIEW("PratosFiltrados", NOT(CONTAINS([Dieta], [_thisrow].[Filtro])))

It works only if [Filtro] is comprised of one selection. If the user selects multiple allergies, the expression does not work.

 

Any light?

Solved Solved
0 6 244
1 ACCEPTED SOLUTION

Hello Skr0YC

I added SPLIT() to both columns in your solution and it work. Thank you for the input!

View solution in original post

6 REPLIES 6

Complementing the question:

The desired result would be the selection of recipes which does not contain any of the allergens selected in the [Filtro].

[Filtro] es un EnumList
[Dieta] es tambiรฉn una lista

En teorรญa, si cruzas ambas listas, esperas que no tengan nada en comรบn para poder pasar el filtro.

Prueba con:

ISBLANK(
  INTERSECT(
    [Dieta],
    [_THISROW].[Filtro]
  )
)

No good. 
Result: INTERSECT does not accept a list of list.

Pues ese es otro problema, indรญcanos la configuraciรณn de [Dieta] y [Filtro]

Hello Skr0YC

I added SPLIT() to both columns in your solution and it work. Thank you for the input!

Share us the config so that we can see why you are using a List of Lists.

Also notice that just using SPLIT() won't always solve the issue or may even just look like it was solved

Top Labels in this Space