Hey folks, This has to do with an expression...

Hey folks,

This has to do with an expression to render a drop-down list.

I have a column, [Employee Name] in a form my employees are filling out.

This has an initial value and a ref to a list of employee names.

Then there is a second column called [Co-gardener] for the option of listing another employeeโ€™s name.

However, I would like to make sure that the list of employees that comes up in the drop down list will not allow people to select the same person as was selected in the [Employee Name] column.

I have tried this expression:

AND(SELECT(Employees[Employee Name], [Crew] = โ€œMaintenanceโ€), NOT([Employee Name] = [_THIS]))

But it does not validate.

Funny thing is, the SELECT expression on its own validates, and the NOT expression on its own validates, but not the two together.

Am I using the AND expression wrong to bind them together?

Any ideas on what Iโ€™m doing wrong?

Many thanks! Miranda

0 3 374
3 REPLIES 3

Stan
New Member

I think you can do this in this way:

SELECT(Employees[Employee Name], AND([Crew] = โ€œMaintenanceโ€ , NOT([Employee Name]=[_THISROW].[Employee Name])))

Youโ€™ll create a list of all the employee names that are not equal to name in the first column.

SELECT(Employees[Employee Name], [Crew] = โ€œMaintenanceโ€) does not produce a Y/N value, but AND() wants a Y/N value, hence the validation failure. @Stanโ€™s suggestion is the right one.

@Stan @Steven_Coile thank you!! Success!!

Top Labels in this Space