Forum Discussion

Vigneshwar's avatar
Vigneshwar
New Contributor
2 years ago

Alternate column different background color

Is there a way to display alternate columns in different colors even if we apply expansion (e.g.   .tree , .children etc.)

  • HoneyGulati's avatar
    HoneyGulati
    New Contributor III

    Do you mean rows or columns?

    We can achieve it through conditional formatting in Cube views

     

    • Vigneshwar's avatar
      Vigneshwar
      New Contributor

      It is for Columns 

      Can you give some sample codes to achieve alternate colors to the column when we use expansion

      • HoneyGulati's avatar
        HoneyGulati
        New Contributor III

        The conditional formatting can be done based on various factors such as indent level  , member description , header display text etc

        For Ex: I used 2024.base in my columns which will populate all the months of 2024 and then used header display text to add colors to alternate months

        Formatting

        If (ColE2HeaderDisplayText Contains 'Apr') OR (ColE2HeaderDisplayText Contains 'Jun') OR (ColE2HeaderDisplayText Contains 'Aug') OR (ColE2HeaderDisplayText Contains 'Oct') OR (ColE2HeaderDisplayText Contains 'Dec') OR (ColE2HeaderDisplayText Contains 'Feb') Then

        BackgroundColor = Linen
        Else

        BackgroundColor = SkyBlue
        End if