20 Replies Latest reply: Dec 4, 2017 11:20 PM by Apoorva Dhulehole RSS

    Stacked bar chart which sums up to 100 %

    Apoorva Dhulehole

      Hello Everyone,

       

      I have a requirement in which I have to create a stacked bar chart in which all the expressions should sum up to 100 %. I have four expressions and one dimension. When I choose one dimension value I get total as 100 % but if I leave it as it is, values are unrealistic as shown in  below pictures.

       

      Image 1.PNG

       

      Image 2.PNG

       

      Also checked on community and found a solution which says, expression to be like: sum(Expression)/sum(TOTAL <Dimension> Expression). But my expression is a little complex and has the function "sum" in it already, so I cannot use "sum" again. One of the expression is as shown below:

       

      if(F1='ONLine',(sum({$<Station={"BMM"}>}[Total Pieces Produced]/[Max pc/hr])/sum({$<Station={"BMM"}>}"Operating Time [h]"))*(sum({$<Station={"BMM"}>}"Operating Time [h]")/sum({$<Station={"BMM"}>}"Planned Prod. Time [h]"))

      *(1-(sum([Scrapped Pieces])/sum({$<Station={"BMM"}>}[Total Pieces Produced]))),

       

       

      if(F1='OFFLine',(sum({$<F1={"OFFLine"}>}"Operating Time [h]")/sum({$<F1={"OFFLine"}>}"Planned Prod. Time [h]")

      *sum({$<F1={"OFFLine"}>}"Planned Prod. Time [h]")/sum({$<Station={"BMM","Assembly","Welding"},Product=, F1={"OFFLine"}>}"Planned Prod. Time [h]"))

       

       

      *

       

       

      (sum({$<F1={"OFFLine"}>}[Total Pieces Produced]/[Max pc/hr])/sum({$<F1={"OFFLine"}>}"Operating Time [h]")

      *sum({$<F1={"OFFLine"}>}"Operating Time [h]")/sum({$<Station={"BMM","Assembly","Welding"},Product=, F1={"OFFLine"}>}"Operating Time [h]"))

       

       

      *

       

       

      (sum({$<F1={"OFFLine"}>}[Total Pieces Produced]-[Scrapped Pieces])/sum({$<F1={"OFFLine"}>}[Total Pieces Produced])

      *sum({$<F1={"OFFLine"}>}[Total Pieces Produced])/sum({$<Station={"BMM","Assembly","Welding"},Product=, F1={"OFFLine"}>}[Total Pieces Produced]))))

       

      How do I get this to work?

       

      Any suggestions?

       

      Thank you.