Got it (thx to stackoverflow) using a global dictionary
{% set global = {} %}
{% for interface in __interfaces %}
{% if something matches %}
{% set _ = global.update({MyVariable:"This is a Test"}) %}
{% endif %}
{% endfor %}
{% set MyVariable = global["MyVariable"] %}
{{ MyVariable }}