Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
Problem calculating Weight using values form another column
posted

Hi,

I am trying to calculate weights based on values in another column using the column formula :

Formula =

"[Currency] / sum( [Currency] )"

I get weight as 1 for this formula.  

I have a summary column for Currency  to show the Sum and it displays properly.  Am I missing anything?

 

Thanks for your help and time !

Cheers

Naveen

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Naveen,

    Assuming that this formula is not applied to the Currency column, then the problem here is that [Currency] refers to a single cell, not a whole column. Putting a sum function in there doesn't change the interpretaion of what "[Currency]" means. You are summing a single cell. So you are essentially dividing the value of the currency cell in the same row by itself. That's why it's always 1.

    You need to dive the value in the current row by the entire column. To refer to the entire column, you would use an asterisk, like this:

    .Formula = "[Currency] / sum([Currency(*)])"

    This will work, but it's very inefficient, since the sum of the currency column will be re-calculated for every row, every time a value in the column changes.

    A better way to do this would be to store the sum of the column somewhere else, like in a summary for the band. You would add a summary to the band and assign a Key to that summary, and then formula for the summary would be simply: "sum([Currency])". You don't need the asterisk in this case because in the context of a summary, [Currency] refers to the entire column.

    Then your cell formula would be:

    "[Currency] / [Key_Of_Currency_Summary]"

     

Children