12 Replies Latest reply: Dec 10, 2017 11:18 PM by Apoorva Dhulehole RSS

    Aggr function within a sum function

    Apoorva Dhulehole

      Hello Everyone,


      I am using aggr function within sum function as shown in the below expression. The problem is, since I am using "if" statement, the bar chart some how doesn't display the data until I choose a value in field, "F1". After using aggr function this problem is eliminated and the graph displays value even without making a selection in "F1". But now when I choose one particular week, data displayed is right, but if I choose more than one week, expression sums up for both the weeks and displays it as just one bar as shown in the below screenshot. I would want to see % values for how many ever weeks I choose. So here when I choose week1 and week2, % values for both the weeks should be visible in the graph. How do I do this?



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

      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"},F1={"OFFLine"}>} "Planned Prod. Time [h]")

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



      Two weeks.PNG


      One week.PNG


      Any suggestion?


      Thank you.