{% if column in properties.report_ratio_columns and (column in totals|keys or forceZero|default) -%}
    {% set reportTotal   = totals[column]|default(0) %}

    {% if siteTotalRow is defined and siteTotalRow is not empty %}
        {% set siteTotal = siteTotalRow.getColumn(column) %}
    {% else %}
        {% set siteTotal = 0 %}
    {% endif %}

    {% if rowPercentage|default is empty %}
        {% if row.getMetadata(column ~ '_row_percentage') != false %}
            {% set rowPercentage = row.getMetadata(column ~ '_row_percentage') %}
        {% elseif row.getColumn(column)|default(0) is numeric and reportTotal is numeric %}
            {% set rowPercentage = row.getColumn(column)|percentage(reportTotal, 1) %}
        {% else %}
            {% set rowPercentage = '' %} {# should not happen #}
        {% endif %}
    {% endif %}

    {% set metricTitle   = translations[column]|default(column) %}

    {% set reportRatioTooltip = 'General_ReportRatioTooltip'|translate(label, rowPercentage, reportTotal, metricTitle, '"' ~ segmentTitlePretty ~ '"', translations[labelColumn]|default(labelColumn)) %}

    {% if totalPercentage|default is empty %}
        {% if row.getMetadata(column ~ '_site_total_percentage') != false %}
            {% set totalPercentage = row.getMetadata(column ~ '_site_total_percentage') %}
        {#- without a site summary row siteTotal falls back to 0, which is no total to relate a row to -#}
        {% elseif row.getColumn(column)|default(0) is numeric and siteTotal is numeric and siteTotal > 0 %}
            {% set totalPercentage = row.getColumn(column)|percentage(siteTotal, 1) %}
        {% endif %}
    {% endif %}

    {% if totalPercentage|default is not empty %}
        {% set totalRatioTooltip = 'General_TotalRatioTooltip'|translate(totalPercentage, siteTotal|number(2,0), column == 'nb_visits' ? 'General_ColumnNbVisits'|translate : metricTitle, periodTitlePretty) %}
    {% else %}
        {% set totalRatioTooltip = '' %}
    {% endif %}

    {#- the tooltip is rendered as HTML from this attribute, and the browser decodes the attribute
        again when it is read back, so every value interpolated here is escaped exactly once -#}
    <span class="ratio"
          title="{{ reportRatioTooltip|rawSafeDecoded|e('html_attr') }} {{ totalRatioTooltip|rawSafeDecoded|e('html_attr') }}{% if tooltipSuffix|default is not empty %}<br/><br/> {{ tooltipSuffix|rawSafeDecoded|e('html_attr') }}{% endif %}"
    >&nbsp;
        {%- if showAbsoluteValueOnHover|default -%}
            {%- if row.getMetadata('html_column_' ~ column ~ '_prefix') -%}
                <span class='column-prefix'>{{ row.getMetadata('html_column_' ~ column ~ '_prefix') | raw }}</span>
            {%- endif -%}
            {{- row.getColumn(column)|default(0)|number(2,0)|rawSafeDecoded -}}
            {%- if row.getMetadata('html_column_' ~ column ~ '_suffix') -%}
                <span class='column-suffix'>{{ row.getMetadata('html_column_' ~ column ~ '_suffix') | raw }}</span>
            {%- endif -%}
        {%- else -%}
            {{- rowPercentage -}}
        {%- endif %} {% if changePercentage|default is not empty %}({{ changePercentage }}){% endif %}</span>
{%- endif %}
