Advanced where clause – pass variable into annonymous function