Search code examples
iccubeiccube-reporting

IcCube Reporting V8 : Multi Header Pivot - Conditional Color expression


Using IcCube Reporting V8, I want to do conditional colors in the cells of a pivot column, the problem is that I can't identify this column when there are multiple header levels :

In the sample below, I want to identify the column "Interventions/Evolution" enter image description here

Picture below shows that $_currentColumn.mdxName$ reports only the 1st row header text "Interventions" even though the current column mentions the complete one "Interventions, 2019":

enter image description here

How can I catch the complete column name in order to apply conditional colors ?


Solution

  • The Current Column selection menu in the expression editor sets the currentColumn only for the editor (so you can test the expression). The transformation itself runs on all the selected columns where each iteration the currentColumn changes.

    There are two ways to apply a conditional color transformation to a single column from the table.

    • Set the columns option of the transformation to only the "Interventions/Evolution" column.
    • Set the columns option to All Columns and use the following expression:
    if ("$_currentColumn.caption$".startsWith("Interventions")) {
      return "blue";
    }
    return "purple";