I have a table with multiple columns. Important columns for this topic are โCategoryโ (Values = โTrailsโ, โNatureโ, โCultureโ, โServiceโ), โTrailsโ (Values = โTreadโ, โBackslopeโ, โJumpโ, โFeatureโ), โNatureโ (Values = โLakeโ, โProtected areaโ, โWildlife reservatโ), โMeasuresโ (only one Value: โRecordโ), โM1โ (Values = โA1โ, โA2โ, โA3โ), โM2โ (Values = โB1โ, โB2โ, โB3โ) and โM3โ (Values = โD1โ, โD2โ, โD3โ). All these columns are EnumLists.
If these columns should be visible is defined by expression. However, there are multiple difficulties which do not work by now.
Measures: Show = OR([Category] = โTrailsโ, [Category] = โNatureโ)
โ the Button Measures should only be visible if either Trails or Nature is selected
M1: Show = AND(IN([Trails], LIST(โTreadโ, โOtherโ, โOtherโ)), [Measures] = โRecordโ)
โ M1 should only be visible, if Tread is selected (or Others)
M2: Show = AND(IN([Trails], LIST(โJumpโ, โFeatureโ, โOtherโ)), [Measures] = โRecordโ)
โ M2 should only be visible, if โJumpโ or Feature (or Others) is selected.
โ If both Tread and Jump is selected, M1 and M2 should be visible.
M3: Show = AND(OR(IN([Trails], LIST(โBackslopeโ, โOtherโ, โOtherโ)), IN([โTrailsโ], LIST(โProtected areaโ, โOtherโ, โOtherโ)), [Measures] = โRecordโ)
โ M3 should only be visible, if Backslope (or Others) or Protected area (or Others) is selected.
Rules (how they should work and how they do by now):
So, it is important, that it is shown as soon as at least one defined value is selected. If two are selected which refer to two different Mโs, both Mโs should be shown. By now itโs only shown if the two values are in the definition of the same M. Otherwise no M is shown.
At the moment it is also like that, that M3 (which should be visible either by Trails or Nature is always shown (even if no defined value is selected).
How can I change my expressions that above rules do work correctly?
Solved! Go to Solution.
Change AND()
for OR()
where that happens.
This should be working
Post the whole thing to help you with the expression. In general, it seems OK. M1 should be shown if the value inside [Trails]
is one of the values from the LIST()
you made and the value inside [Measures]
is โRecordโ (btw, why you have this column if only one value is available? Itโs defined by an expression?)
This also seems ok.
Ok also.
This all boils down to this I think:
So if [Trails]
is a list, you are comparing a list with another. IN()
was not meant for this kind of things.
See:
Try replacing your IN()
with this: (M1 for example)
ISNOTBLANK(
INTERSECT(
[Trails],
LIST("Tread" , "Other", "Other")
)
)
I donโt get why you are using AND()
to wrap most of your stuff. IN()
doesnโt need that.
Also, always write textual values "Like this"
instead of Like this
.
Try that.
Very much true.
Sorry, yes, I do wrap text in โtextโ normally. I was confused because of the * for bold text etc. And I also forgot to add [Measures] = โRecordโ) which is the reason why I use AND()
So, post here the actual config for us to see and help
I changed it in the first post!
Change AND()
for OR()
where that happens.
This should be working
Post the whole thing to help you with the expression. In general, it seems OK. M1 should be shown if the value inside [Trails]
is one of the values from the LIST()
you made and the value inside [Measures]
is โRecordโ (btw, why you have this column if only one value is available? Itโs defined by an expression?)
This also seems ok.
Ok also.
This all boils down to this I think:
So if [Trails]
is a list, you are comparing a list with another. IN()
was not meant for this kind of things.
See:
Try replacing your IN()
with this: (M1 for example)
ISNOTBLANK(
INTERSECT(
[Trails],
LIST("Tread" , "Other", "Other")
)
)
Hi @Phil!
Any comments about this?
Is IN()
V2 in the works?
Thanks a lot, youโre great! It was really only because IN() canโt compare lists with another.
Using following code instead of IN() does what I want and solved all my problems.
ISNOTBLANK(
INTERSECT(
[Trails],
LIST("Tread" , "Other", "Other")
)
)
THANKS!!!
FYI: I use the column Measures because Iโm not always using the Measures and it looks better if you have to press the button Measures in case you want to add some measures
Nice!
User | Count |
---|---|
15 | |
14 | |
8 | |
7 | |
4 |