title: COGNOS: Compare column with previous column in a crosstab with dnamically generate columns
body: <p>-
  Hi all, i need to change the color of the values based on a condition. If the value of the previous column is lower then the actual value then the value should be blue otherwise the value should be grey. I am working with a crosstab and the columns are dynamically generated. Is it somehow possible to do this without changing to static columns? </p>
  
  <p><a href="https://i.stack.imgur.com/W9sj8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W9sj8.png" alt="enter image description here"></a></p>
  
  <p><strong>Additional notes:</strong></p>
  
  <p>If I use a column that contains only one attribute, then it works. But if my column contains multiple attributes, then it doesn't work. </p>
  
  <p>For example, I want to see the sales for different departments for the last 12 months. If the column contains more then one attribute then Cognos compares the sum off all departments of the current month with that sum of the previous month and colors all values of this month with the same color. </p>
  
  <p>In the "Added Picture" you can see the outcome of my query as the output of the crosstab. </p>
  
  <p><a href="https://pasteboard.co/IKJ3Opv.png" rel="nofollow noreferrer">Added Picture</a></p>
  
  <p>In my query i have created a data item "Style" that displays 'a' if the actual month is bigger and 'b' if its lower. I am using this Data Item for Conditional Style. </p>
  
  <p>Thanks in advance</p>