4 Replies Latest reply on Aug 30, 2018 12:22 PM by Ken Flerlage

# Need to create calculations in a text table

Hello

I am struggling to create two simple calculations in this text table.  I would like to maintain the same data source file structure.

Calculation 1:

Blue+Green (Desired Result:  15.0, 17.0, 19.0)

Calculation 2:

Red / (Blue + Green) ((Desired Result:  1.3, 1.2, 1.2)

I appreciate the help.

Regards,

• ###### 1. Re: Need to create calculations in a text table

With the structure of your data as is, you'd have to create three of each calculation, one for each type. The calculation would look something like this:

IF [Color Type] = "Blue" or [Color Type] = "Green" THEN

[Type 1]

END

Then repeat that for Type 2 and Type 3.

Then create something similar for Color Type Red Only.

Finally, do the math of the sets of calculations.

Does that make sense?

The one question I have is how you want to display these. It could be tricky to put these on your existing table.

1 of 1 people found this helpful
• ###### 2. Re: Need to create calculations in a text table

Something along the lines of the attached is one approach although it takes MANY calculated fields..  I just started the calcs to give you an idea.

1 of 1 people found this helpful
• ###### 3. Re: Need to create calculations in a text table

Thanks Ken Flerlage and John Sobczak

Is it still possible to add those calculations with this structure?

I am afraid I previously provided the incorrect data source file.

1 of 1 people found this helpful
• ###### 4. Re: Need to create calculations in a text table

Yes, it simplifies things a bit. Instead of having to create a different calculated field for all three measures, you could just create the following:

Blue/Green

IF [Color type] = "Blue" or [Color type] = "Green" THEN

[Value]

END

Red

IF [Color type] = "Red" THEN

[Value]

END

Red/BG Ratio

SUM([Red])/SUM([Blue/Green])

See attached workbook.

1 of 1 people found this helpful