5 Replies Latest reply: Mar 21, 2016 6:44 AM by Oliver Krause RSS

    Problem using variable inside another complex aggregation formula

    Oliver Krause

      Dear all,

       

      I define a formula using set analysis in my script:

       

      SET eAnzahlSollPF = Max({<Config_AnzahlSollFzge.Produktlinie=Config_Produktlinie.Produktlinie, Config_AnzahlSollFzge.I_Stufe=%I_Stufe.NAME>} [Config_AnzahlSollFzge.Anzahl-Soll-PF]);

       

      When I only put $(eAnzahlSollPF) as expression in the chart, I get with my current selection 4:

       

      and I need to use the above variable within THIS formula (when I replace the XXXXXX with a 4 I get the graph below, when putting the formula above I get no values):

      =RangeSum(         Above(

                  [Config_Soll_LC.Soll-Wert]* XXXXXX,

                  0,

                  RowNo()

              )

          )/Sum(TOTAL Aggr( Sum({< %IWeek = p(%IWeek), IStufenWk.MS = p(IStufenWk.MS)>} [Config_Soll_LC.Soll-Wert] * XXXXXX), %IWeek, IStufenWk.MS))

       

      I get the graph I need:

      But when replacing the 4 by $(eAnzahlSollPF)

      in this line

      Sum(TOTAL Aggr( Sum({< %IWeek = p(%IWeek), IStufenWk.MS = p(IStufenWk.MS)>} [Config_Soll_LC.Soll-Wert] * 4), %IWeek, IStufenWk.MS)) :

       

       

      =RangeSum( //eSollKurveRel

              Above(

      [Config_Soll_LC.Soll-Wert]*$(eAnzahlSollPF),

                  0,

                  RowNo()

              )

          )/Sum(TOTAL Aggr( Sum({< %IWeek = p(%IWeek), IStufenWk.MS = p(IStufenWk.MS)>} [Config_Soll_LC.Soll-Wert] * $(eAnzahlSollPF)), %IWeek, IStufenWk.MS))

       

      I only get this

       

      I get no values...

       

      Any idea what I do wrong?