|
{% if isComparingSegments %}
{%- set comparisonLabel = row.getMetadata('compareSegmentPretty') -%}
{% else %}
{%- set comparisonLabel = comparePeriod -%}
{% endif %}
{{ comparisonLabel }}
|
{% for dimension in dimensions %}
{% if loop.index0 != 0 and dimension in properties.columns_to_display %}
|
{% endif %}
{% endfor %}
{% for column in properties.columns_to_display %}
{% if column != 'label' and column not in dimensions %}
{% set columnValue = row.getColumn(column) %}
{% set rowComparisonTotals = comparisonTotals[seriesIndex].totals|default(null) %}
{% set comparisonTooltipSuffix = '' %}
{% set columnChange = false %}
{% if row.getColumn(column ~ '_change')|default is not empty %}
{% set columnChange = row.getColumn(column ~ '_change')|default('+0%') %}
{% set comparisonTooltipSuffix = 'General_ComparisonRatioTooltip'|translate(columnChange, row.getMetadata('compareSegmentPretty'), comparedPeriodPretty) %}
{% endif %}
{% include "@CoreVisualizations/_dataTableViz_htmlTable_ratio.twig" with {
'changePercentage': columnChange,
'totals': rowComparisonTotals,
'label': comparedRow.getColumn('label'),
'labelColumn': properties.columns_to_display|first,
'forceZero': true,
'tooltipSuffix': comparisonTooltipSuffix,
'translations': properties.translations,
'segmentTitlePretty': row.getMetadata('compareSegmentPretty'),
'periodTitlePretty': row.getMetadata('comparePeriodPretty')
} %}
{{ columnValue|default(0)|number(2,0)|rawSafeDecoded }}
|
{% endif %}
{% endfor %}
{% set lastSeenComparePeriod = comparePeriod %}
{%- endfor -%}
{% endif %}