I would like to know how to retrieve the appropriate record in the following scenario:
I have a table with an expression "Demand" which is the distinct count of a field value. Simple. The records counted are based not just on a selection, but on a variable date range specified by variables in input boxes. I give this exposition because it does not seem that my solution lies in the script.
Nevertheless, as indicated by the image attached, I would like to determine the appropriate Stock Qty value to return by finding the record whose Min/Max Threshold range contains the value I calculate in "Demand". Any pointers? I'm sure there's a function I'm failing to consider or implement properly. There has to be an easy way to do this.