Nested repeat regions, use value from parent repeat region to filter nested
I have managed to nest a repeat region within a parent repeat region but I am struggling to get a parent column value to the nested region so I can filter.
I have tried to generate a variable using 'Add Variable' but on creating a variable with this I get the error message '$client_id is an invalid variable name; it does not appear in the SQL'. If this isn't the correct way to generate a variable to share between parent region and nested region please let me know.
If it is the correct way what am I doing wrong? Thank for your help (I have attached present code)