I'm using CONTAINS to filter a REF column. Th...

(simon bailey) #1

I’m using CONTAINS to filter a REF column. The REF is a Job. The column it checks is the Days. This works except I have Day 1 and Day 10 that can be in the column. So when it checks for Day 1 it allows Day 10.

Is there any fix for this? I could put a comma after the number, Day 1, but if Day 1 is the only day that’ll be missed then.

Hope that makes sense. I know I haven’t put much info. Thanks

(Praveen Seshadri (AppSheet)) #2

Why are you using Contains() to filter the Ref column? Can’t you use

= instead?

(simon bailey) #3

Nope, unfortunately not. It’s an Enumlist that goes into a cell. I did originally have the days as seperate columns, but this seems better (in some ways) Including that I need to reference the same column to check which day (I think). I’m getting a bit confused so may be doing things weirdly.

Only just started using Valid_if to filter REF columns, which is really useful. I previously had a seperate sheet in my google doc for every day, so had to do every change 10 times.

(Praveen Seshadri (AppSheet)) #4

I see, so you want to see if a value is in a list? How abou using IN(“Day1”, [ListColumn])

(simon bailey) #5

I want to be able to choose a value from a list if another column contains the correct Day. =SELECT(Venues[Venue],CONTAINS([Days],[Day Number Spreadsheet]))

That’s the expression I’m using.

I don’t know the IN expression. Would that be a good way to do it? Wouldn’t that still see Day 10 as Day 1? or does IN find an exact match for a word with no spaces?

(Praveen Seshadri (AppSheet)) #6

SELECT(Venues[Venue], IN([Day Number Spreadsheet], [Days]))

That’s the syntax. Is Day Number Spreadsheet a column in the Venues table?

Or if you are entering data in one table and looking to get values from another table, you should use something like this

SELECT(Venues[Venue], IN([_THISROW].[Day Number Spreadsheet], [Days]))

(simon bailey) #7

Thanks. That works and I think I kind of understand it. I will when I use it a few times, which I think I’ll need to.

(simon bailey) #8

Thanks again. This helps a lot. Just anted to put on here, in case anyone reads this to use it, the column it’s checking, in my case [Days], need to be Enumlist (probably Enum as well)