8 Replies Latest reply: Feb 7, 2012 6:39 AM by Rowan Mills RSS

    Colour expression in a chart

      Hi all,


      I'm having a problem presenting a chart using an expression for the column colour.


      I have a bar chart that presents financial data that is broken down in various ways but mainly department, team, spend, budget and one of the views is Spend v Budget.


      I work this out using calculation Sum (Costs)-((Sum (Budget))/12*Count (DISTINCT Month)), then the expression used to display the chart colour is if(($(vVar))>=0,Green(),Red()) where vVar = Sum (Costs)-((Sum (Budget))/12*Count (DISTINCT Month)).


      When you choose a team from a list box the chart will show green or red depending on the result of the selection so in that case it works fine.


      The problem comes where the chart is shown with no team selected and is shown as departments - all bars, whether in the positive or negative financially show as red because the total variance for all budgets is a negative value.


      Is there a simple way to show all fiigures above 0 in a chart as green and all those beneath 0 as red - or another way round this. If i'm not clear please let me know.