We can use a window_sum that sums all the values for your number of chickens within a single barn, as attached.
Note the table calc (right click) compute using is set to "Animal" so the sum operates on each barn. WIth your real dataset you will likely need to set the advanced properties so that the only discrete pill on the left is barn:
Great tbwx and question framing - makes it so mush easier...
FilterGroup.twbx.zip 37.1 KB
Thanks for the very quick response, and yes that's getting very close to the desired result with all the fields showing - but the GRAND TOTAL still add the animals from barn B (the total should be 38, but it's still counting 5 pigs + 5 cows in Barn B and showing 48)
Also, is it possible to achieve the same effect WITHOUT having animal-type showing, and just summing the number of animals in each barn (not specifying how many of each type, just the total). Leaving ANIMAL in the detail shelf seems to create a situation where multiple numbers appear per cell, rather than summing them together)
So to the second point, yes with another quick calc and putting Animals on the level of detail. Now we have to customize the grand total (which means I have to reread these from Jonathan Drummey (Customizing Grand Totals – Part 1 | Drawing with Numbers)
FilterGroup.twbx.zip 41.8 KB