Thanks for the reply.
I tried both data-sly-test and data-sly-set but not sure why the value of "concatenated" is coming only "-" in the hreflang, however analyticsItem.country and analyticsItem.locale coming properly from the model. So if country is not international its coming like this in the output-
<link rel="alternate" hreflang="-" href="http://localhost:4502/content/myproject/content/br/en/test.html"/>
Per the Block statements priority, data-sly-set/data-sly-test is evaluated before data-sly-repeat.
ie. analyticsItem identifier is not available when data-sly-set/test executes and only "-" is set to the concatenated identifier and hence to the hreflang attribute.
https://experienceleague.adobe.com/docs/experience-manager-htl/using/htl/block-statements.html#available-block-statements
You can move the String concatenation to backend and have it accessible as straightforward/single value (like you have locale/country)