Hi there!
Iยดm using Linktofilteredview().
I have a table (Table A) I want to filter based on a specific column [Meso] through user input (Form A).
Column [Meso] is an EnumList with the following possible values (M1,M2,M3,M4), with โcommaโ as the separator.
User can select one or all those values using Form A.
The idea is to filter all rows in Table A where the value or values inputted by the user are present. I have tried to use an expression with โINโ, but Linktofilteredview() only gives back the exact pattern (For example: If the user select โAโ, we doesnยดt obtain any result.This is wrong because we have rows in Table A with [meso] = โA,Cโ. The desired output for that input would be all rows where โAโ is present.
What can I do? Thank you very much in advance,
Diego
Solved! Go to Solution.
Try this:
LINKTOFILTEREDVIEW(
"Table A",
(
COUNT([meso] - LIST())
<> COUNT([meso] - [_THISROW].[meso])
)
)
COUNT([meso] - LIST())
counts the distinct items of [meso]
. Subtracting one list from another has the side-effect of removing duplicate list items.
COUNT([meso] - [_THISROW].[meso])
counts the distinct items of [meso]
that are not also present in [_THISROW].[meso]
.
(COUNT(...) <> COUNT(...))
asks whether the count of (distinct) items in [meso]
changes if items also in [_THISROW].[meso]
are removed. If [_THISROW].[meso]
contains items also in [meso]
, the counts will be different.
What is the formula you have tried to use?
Hi Aleksi:
This is the formula:
LINKTOFILTEREDVIEW(โTable Aโ,IN([meso],[_THISROW].[meso]))
What is your โmesoโ column type in table A?
[meso] in Table A is EnumList and [meso] in Form A is also an EnumList
Initially, I tried [meso] in Table A to be Textโฆbuy I had some problems with LINKTOFILTEREDVIEW() comparing with the input from the form (List). So I assigned both columns to be EnumList. Now LINKTOFILTEREDVIEW() worksโฆbut not the way I want.
Is there any other way to filter Table A based on this column? I have seen something about Slicesโฆbut I started with this option.
The problem is your filter. You are trying to compare list against list and IN expression is not meant for that. Letโs say you have options 1,2,3 selected in both columns. IN formula will make three different comparingsโฆ 1,2,3=1, 1,2,3=2 or 1,2,3=3. As you can see the answer is always false.
Thank you Aleksi.
So, what are the available alternatives for this case?
Try this:
LINKTOFILTEREDVIEW(
"Table A",
(
COUNT([meso] - LIST())
<> COUNT([meso] - [_THISROW].[meso])
)
)
COUNT([meso] - LIST())
counts the distinct items of [meso]
. Subtracting one list from another has the side-effect of removing duplicate list items.
COUNT([meso] - [_THISROW].[meso])
counts the distinct items of [meso]
that are not also present in [_THISROW].[meso]
.
(COUNT(...) <> COUNT(...))
asks whether the count of (distinct) items in [meso]
changes if items also in [_THISROW].[meso]
are removed. If [_THISROW].[meso]
contains items also in [meso]
, the counts will be different.
Fantastic Steve, it works! Thank you very much and have a nice day
User | Count |
---|---|
26 | |
25 | |
24 | |
22 | |
20 |