2 Replies Latest reply: Oct 6, 2016 7:48 AM by naveen kumar RSS

    how to write this exp

    naveen kumar

      HI All,

       

      How to write this expression,

       

       

      week          quantity        tm

      week1           100             10

      week1             200             20

      week1              50               5

      week2          800               80

      week2             120            20

      week2            500              5 5

       

       

      if i select week1 from week i should get this=

                                                           100*10+200*20+50*5

                                                            -------------------------------

                                                                  100+200+50

       

       

      if i select week2 from week i should get this=

                                                               800*80+120*20+500*55

                                                              --------------------------------------

                                                                     800+120+500


      a dynamic exp which should change with selection


      thanks

        • Re: how to write this exp
          Sunny Talwar

          May be this:

          Sum(quantity*tm)/Sum(quantity)

           

          Update: I hope that you are using this in a text box object, right?

          If you are not, then may be this:

          Sum(TOTAL quantity*tm)/Sum(TOTAL quantity)

          or

          Sum(TOTAL <week> quantity*tm)/Sum(TOTAL <week> quantity)

            • Re: how to write this exp
              naveen kumar

              i tried in textbox ,its working actually i need this exp for one of my bar chart ....i will try the two other exp

              can u say wats the diff b/w these exp...

              Sum(TOTAL quantity*tm)/Sum(TOTAL quantity)

              or

              Sum(TOTAL <week> quantity*tm)/Sum(TOTAL <week> quantity)


              what actually this does <week>