Forum Discussion
Lookup Value From Within Virtual Table
- 7 months ago
Hi diablo9081
You could perform a lookup-equivalent with an expression like this:
SELECTCOLUMNS ( FILTER ( __DataTransformT0, [v_Clinic_Decode] = "<LOOKUP_VALUE>" ), [ClusterId] )Assuming
__DataTransformT0is guaranteed to contain at most one row perv_Clinic_Decode(which should be the case here), this would return a 1x1 table (orBLANK) which is automatically converted to a scalar value where required.Alternatively, you could consider using
DEFINE TABLErather thanDEFINE VARfor__DataTransformT0which would create a table for the duration of the query. You could then reference this table as though it were a model table in an expression like this:LOOKUPVALUE ( __DataTransformT0[ClusterId], __DataTransformT0[v_Clinic_Decode], "<LOOKUP_VALUE>" ) )See here.
Hello diablo9081,
We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges? Your update will be valuable to the community and may assist others with similar concerns.
Thank you.