3 Replies Latest reply: Jan 11, 2017 7:04 AM by Sunny Talwar RSS

    ValueList and aggr

    Sabine Böning

      Hello,

       

      I really need your help with ValueList and aggr function.

       

      I have table with power usage and want to give out the KW and the KwH per phase . We have 3 phases.

       

      My ValueList: =ValueList('Phase 1','Phase 2','Phase 3', 'Summe')

      Tabelle.jpg         


      My actual expression for KW is:

       

      if(ValueList('Phase 1','Phase 2','Phase 3','Summe')='Phase 1',

      sum(aggr(avg(phase1_avg),PDU1)),
      if(ValueList('Phase 1','Phase 2','Phase 3','Summe')='Phase 2',

      sum(aggr(avg(phase1_avg),PDU1)),
      if(ValueList('Phase 1','Phase 2','Phase 3','Summe')='Phase 3',

      sum(aggr(avg(phase1_avg),PDU1)),
      if(ValueList('Phase 1','Phase 2','Phase 3','Summe')='Summe',
      sum(aggr(avg(phase1_avg),PDU1))          
      +
      sum(aggr(avg(phase1_avg),PDU1))
      +
      sum(aggr(avg(phase1_avg),PDU1))
      ))))

       

       

      For KW in phase 2 and 3 I only get 0-Values. It just show the same values like in phase 1.

      When I try with NODISTINCT I get no the right results.

       

      Just for example I used for all ValueList-Options the phase1_avg.

       

      In the real application I will get different values for phase 1, phase 2 and phase 3.

       

      Do you have any idea?

       

       

      Thanks,for any help in adavance.

       

      Best regards
      Sabine