13 Replies Latest reply on Feb 15, 2020 2:47 PM by Apoorva Paygude

# Multiply Values in a Column

I want to multiple all the values present in the column:

0.08

0.29

0.82

0.82

0.77

Total expected: 0.012

• ###### 1. Re: Multiply Values in a Column

How do arrive at 0.012? By understanding how you come up with this number will allow us to help you reproduce it with Tableau.

• ###### 2. Re: Multiply Values in a Column

Are they different fields or values in the same field?

• ###### 3. Re: Multiply Values in a Column

Hey Apoorva,

Unfortunate, Tableau doesn't have a function for this. I never did this, but try something on these lines and let us know if it works.

Regards,

Rohit

• ###### 4. Re: Multiply Values in a Column

I multiplied them

0.08 *0.29*0.82*0.82*0.77=0.012

• ###### 5. Re: Multiply Values in a Column

Nope this wont work

• ###### 6. Re: Multiply Values in a Column

Values in the same field.

• ###### 7. Re: Multiply Values in a Column

Okay, there are a few things you have to do here:

1. Turn off the Aggregate Measures option

2. Sort values by the data source order

3. Use the calculation Rohit Yeruva shared

Here are screenshots in order:

1.

2.

3.

• ###### 8. Re: Multiply Values in a Column

Well done Robert!!

• ###### 9. Re: Multiply Values in a Column

I cannot turn off the Aggregate measure as my column values are coming from the calculation as Sum(A)/Sum(B).

• ###### 10. Re: Multiply Values in a Column

Can you attach your workbook, so that we can take a look

• ###### 11. Re: Multiply Values in a Column

I am unable to attach the workbook but I have this example below for your reference. Below is the screenshot attached of how the value is calculated:

Now I want to multiply all the values in a column and get the result. In this case:

0.4545*0.7895*0.6818*0.8333=0.2038

• ###### 12. Re: Multiply Values in a Column

Alright, you'll need to use a calculation with the same structure as before:

SUM( <row level calculation> ) * PREVIOUS_VALUE(1)

In this case that looks like:

Then you need to layout the table as we did before. Here I've added and INDEX() calculation. The INDEX() calculation is calculationing like:

Then you want to add a LAST() caluclation to the filter and set it to at most 0:

This will result in a viz like the one below after remove then INDEX() and set the other table calculations to calculate exactly as the INDEX() did. You'll need to move ColumnA & B to the details shelf as well.

• ###### 13. Re: Multiply Values in a Column

This works! Thank you very much!