Calling All from variable

Hi,

I have a dashboard variable that produces lots of results from an SQL query. I want to use all of these results as a list within a Elasticsearch query. If I reference the variable I get the first result. I cannot use GROUP_CONCAT in SQL as the results set is larger than 1024

I have tried things like ${__all:myVariable} but just cannot seem to get all of the results.

Would anyone have any suggestions

TIA