12 Replies Latest reply: May 29, 2015 12:54 PM by Rob Wunderlich RSS

    Bar graph coloring not applying appropriatly based on expression

    Matt Mohon

      I've got a stacked bar chart that I want to display, by quarter, sales for the past 2 years.

      The issue I have is, coloring applies correctly to only the Year & Quarter I have currently filtered on.

      How do I edit my coloring expression to fix that? Is it a set analysis issue?

       

      variables set,

      cy = max(year)

      pv = max(year)-1

       

      Dimensions:

      =right(year,2)&'-Q'&qtr

      =1 ---- >I have to add this obligatory dimension to make it a stacked bar, rather than a side by side bar

      =category

       

      Expression:

      sum ({$ <year+={$(cy),$(pv)}, qtr+={*}>}  sales) / sum ({$ <year+={$(cy),$(pv)}, qtr+={*}>}  TOTAL <year,qtr>  dkey)

       

      Bar chart Color Expression:

      pick( match(category,'1','2','3','4'),

      RGB(84,130,53),RGB(101,156,64),RGB(121,187,76),RGB(145,224,92))