Because the underline `_` is a valid character in variable names, `ABC_XYZ_$name_$local_unit_$region_unit_aggregation` tries to expand variables called `$name_`, `$local_unit_` and `$region_unit_aggregation`. The first two are probably wrong. To stop that, put the variable names in question in braces, i.e.
aggr_tablename="ABC_XYZ_${name}_${local_unit}_$region_unit_aggregation"
(or `aggr_tablename="ABC_XYZ_${name}_${local_unit}_${region_unit}_aggregation"` if that's what it should be.)
The quotes aren't strictly necessary in the assignment but otherwise a good idea.
FWIW, shellcheck.net tells of the problem, but sadly not how to solve it, it says:
> ^-- SC2154: name_ is referenced but not assigned (did you mean 'name'?).