Lookup on multiple columns

I have a situation where I have to display one of many records depending which one is active. I already have a dataset the has all the records but it also has many other records. It would be nice to:

lookup(dataset,[‘name’,1], ‘Unknown’, [‘device’,‘state’],‘device’)

This would look for a record where device = “name” (* is wildcard) and state = 1 and return the name of the device or ‘Unknown’

Not looking for alternate ways. Just saying it would be nice to have.

Duly noted.

I know you weren’t looking for alternatives, but for everyone else’s benefit, it might be useful to note that you’d typically let the database do this sort of thing with a dynamic WHERE clause. That said, I certainly understand that there is an argument for doing it in a local expression.