Live Form Count

I have created a virtual column called count. I would like to do the following:

When you select a location from a drop down menu in a live form, it provides a Location ID in a text box. I would like to check against a sliced data “DOB OPEN AND READ ONLY” if the column DOB UNIQUE ID contains the value of LOCATION ID from the live form (The Location ID will always be at the front of the DOB UNIQUE ID. The count is then shown in the virtual column (box on the form). The reason is so I can create a condition where the form will not save if the number is equal to or above 1. This is what I am using:

COUNT(SELECT(DOB OPEN AND READ ONLY[DOB Unique ID], contains([DOB Unique ID],[Location ID])))

It always returns the number 4 (the current number of entries in the DOB OPEN AND READ ONLY slice). If I choose a different location in the live form, the count doesn’t change despite it should count 2. I have tried STARTSWITH but the virtual column count won’t change. Any ideas?

Use [_THISROW]

https://help.appsheet.com/en/articles/2357314-select

Thanks for your reply Marc. I had already resolved the issue by looking at it another way.