 # Multiply a value to a factor multiple (based on column header)

Hi,

I’m building a scaling matrix. I want to multiple the number associated with a column to a weight system (based on a header)

So: for the row Twitter - in the column under ‘Overall Score’ it should =sum((VeryHigh * 10)+(Effort*9)…)

Wasn’t sure how I can associate the column headers to a value from the Factor Multiple table.

goodmorning @Kaveh_Motamed , welcome!

there are various ways to make this work, I prefer this one:

`Sequence(1,[Factor Mulitplier].Count()).formulamap([Factor Mulitplier].Number.Nth(CurrentValue) * List(thisRow.Audience,thisRow.Effort,thisRow.Scalabilty).Nth(CurrentValue)).Sum()`

Of course you cannot multiply ‘very high’ with a number, as you might understand.

Thank you for the answer Christiaan. New to Coda so still learning the formula base logic.

Can you explain what the:

List(thisRow.Audience,thisRow.Effort,thisRow.Scalabilty).Nth(CurrentValue)).Sum()

is doing? When I type in List, I don’t see that function.

okay @Kaveh_Motamed , this logic is based on the observation that we have two lists we need to combine. The first list contains the values factor multiplier and the second list we create by adding all the columns in a singlelist via the function`List()`

Once we have the two list we make them talk by taking each time the `Nth()` value in the list. You see here `Nth(CurrentValue)` The CurrentValue is a position in that that list, so the first, the second, the third and so on as many values you have in the list. This number we generate via the combi of `Sequence()` and `Formulamap()` The first generates a virtual index and the `FormulaMap()` makes sure that every item in both list is evaluated (or calculated). Once we have all values, we `Sum()`

I understand that this could feel complex, in this regard you might benefit from this article in this:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.