|
Assuming I have the following database values of shapes, colors, and weights:
square, blue, 3
triangle, red, 2
triangle, green, 5
square, red, 3
circle, green, 6
triangle, purple, 1
circle, blue, 3
square, green, 7
square, purple, 1
triangle, red, 4
triangle, red, 2
triangle, blue, 4
triangle, green, 1
For this example, I am trying to write formula fields that report back specific sums of weights.
since I am only concerned with triangles, I have entered in my select expert:
{data.shape} = "triangle"
If I were to use the formula:
sum({data.weight})
I would expect a result of "22" (the total weight of all triangles)
Now I would like to write formulas that will report back the total weight of triangles that have specific colors (including colors that are not in the database yet):
blue - 7
red - 8
green - 6
purple - 1
black - 0
total - 22
Without using groups, is it possible to write a select statement within the formula editor, similar to:
sum({data.weight}, {data.color} = "blue")
so that can calculate a sum of weights within a specific color?
I had originally tried using a group subtotal with limited success, but now need to have more control over how the results display (my live data is a little more complicated than this example). The @formula for each sum will be added into text fields on the report, which is already designed.
Edited by supportagent11 - 31 Aug 2011 at 9:44am
|