Thanks for reaching out and replying.
I was trying point 1, applying the condition in the Let Clause and i am getting the following error
"this database function does not support the query option", can you point me in the direction of some link material or sample query for this