7 Replies Latest reply: Jan 15, 2018 4:18 PM by Karen Barberán RSS

    Bad Sum

    Karen Barberán

      Hi World,

       

      I have a question, Can you tell me why the total of the next sum is not corresponding with my values?

      Sum.png

      I attached you a qvf because I'm using an expression for this calculation.

       

      Please, Help me! I need a solution.

        • Re: Bad Sum
          Devarasu R

          Hi,

          U have custom calculated measure, thats why it's shows different number. to fix this just use

          sum(Saldo_Anterior)+ sum(Valor_Cuenta)

          Capture.JPG

            • Re: Bad Sum
              Karen Barberán

              Hi,

               

              Thank you for your help, but in fact, the "1ACTIVO" account must be subtracted from the "2PASIVOS" account, then the personalization helps me differentiate the debtors' credit accounts, therefore, the result I expect is around 10 million. Do you understand me?

            • Re: Bad Sum
              Justin Pham

              Hi Karen,

              I think you should set Measure Saldo Acumulado : Totals Function with Sum option

               

              total.png

               

              Hope this helps.

              Justin.

                • Re: Bad Sum
                  Karen Barberán

                  HI,

                   

                  Thank you for your response, but the result I hope to obtain is around 10 million because one account is a debtor and another creditor

                    • Re: Bad Sum
                      Ruben Marin

                      Hi Karen, you will need to add data that tells wich accounts should substract instead of add.

                       

                      For this particular case maybe works with:

                      Sum(Aggr(If(Left(Cod_Nom_Nivel1, 1)=1

                      , sum(Saldo_Anterior)+ sum(Valor_Cuenta)

                      , (sum(Saldo_Anterior)+ sum(Valor_Cuenta))*-1

                      , Cod_Nom_Nivel1))

                       

                      If each Cod_Nom_nivel1 is related to the multiplier to apply (1 or -1) you can use:

                      Sum(Aggr(If(Left(Cod_Nom_Nivel1, 1)=1

                      , (sum(Saldo_Anterior)+ sum(Valor_Cuenta))*multiplier

                      , Cod_Nom_Nivel1))