8 Replies Latest reply: Jul 17, 2017 7:10 AM by SOWJANYA MOOLA RSS

    sum multiple columns in straight table

      Hi, how do I sum multiple columns in straight table? I want to create column D:

       

      ABCD
      26512
      43714
      17816
      59216

       

      Thanks.

        • Re: sum multiple columns in straight table
          Manish Kachhia

          RangeSum(A,B,C)

          • Re: sum multiple columns in straight table
            Dirk Konings

            =[A]+[B]+[C]

            Expression labels are reused

            • Re: sum multiple columns in straight table
              jagan mohan rao appala

              Hi,

               

              Try like this

               

              =[Expression Name1] + [Expression Name2] + [Expression Name3]

               

              OR

               

              =Column(1) + Column(2) + Column(3)

               

              OR

              = RangeSum(A, B, C)

               

              Hope this helps you.

               

              Regards,

              Jagan.

                • Re: sum multiple columns in straight table
                  Daniel Greenberg

                  Jagan that's right but you run into trouble if you have an unknown number of columns.

                   

                  For example I take a rolling 24 months but hide the column if there is no data so it's not Column(1)+...Column(24)

                   

                  If you go to far and take a column that doesn't exist it shows a -

                   

                  Example

                  showing Nov-2016 - Jan 2016 if I take Column(1) + Column(2) it's good but if I take Column(1)+Column(2) + column(16) it returns a -.

                   

                  Same goes for if using column names which are expressions vDateSubmitted24 through vDateSubmitted1.

                   

                  So what I need to do is figure out the column # in a straight table for this expression and use that to determine the max column # to sum.

                   

                  I don't think you can get the column # from a straight table - I haven't been able to figure it out

                  Rangesum works/fails in same manner.

                    • Re: sum multiple columns in straight table
                      Daniel Greenberg

                      Ha answered my own question.

                      wrap the column with an alt and if it's a non existent column or the sum column it will still work.

                       

                      alt(column(1),0) + alt(column(2),0) + alt(column(3),0) + alt(column(4),0) + alt(column(5),0) + alt(column(6),0) + alt(column(7),0) + alt(column(8),0) + alt(column(9),0)  +alt(column(10),0) + alt(column(11),0) + alt(column(12),0) + alt(column(13),0) + alt(column(14),0) + alt(column(15),0) + alt(column(16),0) + alt(column(17),0) + alt(column(18),0)

                        • Re: sum multiple columns in straight table
                          Daniel Greenberg

                          Ok but something odd is happening with the above.

                           

                          My result is 2x what it should be because it's somehow including that column itself (the total column).

                           

                          Yet if I wrap it in ( )/2 I get a different result that is not correct.

                           

                          However if I add another expression as =TOTAL  //the name of the total column it works.

                          I can hide the TOTAL column on the presentation tab so I have a work around so far.

                           

                          Just not sure how I am going to get the average.

                           

                          When looking at my table below keep in mind this is just what our data set contains the months could be This month (Feb 2017) going back 24 months.  Notice how the first Total column is 2x what it should be.  That's the one that says =alt(column(1),0) + alt(column(2),0) ....  The second Total column says =Total  which matches the name of the previous column.  Very odd.

                          table.png

                    • Re: sum multiple columns in straight table
                      SOWJANYA MOOLA

                      Hi

                       

                      I need to calculate the final balance based on Min Year start and Max Year start . the  date format is in the MMM-YYYY form. I'm writing the below syntax. I know somewhere is wrong. can you please guide me in writing the new syntax.

                       

                      = sum({<new_date={">=$(vYearStart))<=$(vYearMax)"},(sum(DBAL)-sum(WRITE_OFF)-sum(SECURED_RECOVERY)))



                      Thanks in advance.

                      Sowjanya