Custom Formula Syntax for Adding Attribute Totals Across Sheets

Started by visio_user_5273, February 22, 2013, 07:07:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

visio_user_5273

I'm new to the Shape Data portion of visio, but see a world of opportunity for using it.  My situation is that we have many diagrams (all sheets in one Visio file) and each sheet contains varying numbers of, we'll say, Steaks.  Some Steaks are cooked Rare, Medium, or Well, for simplicity.

I have created a master stincile object that has these atrributes defined as shape data labels. (i.e. this master object is a "Five Ruled Column" object from the Annotations stencile, that I copied and made a master from).  This object has shape data labels defined, such as Steak_Rare with a number value, Steak_Med with a number value, etc. 

What I want to do is on the summary sheet have a copy of this master object using the <right click> "Insert Field" option with a Category of "Custom Formula" that can reference all the other sheets and their objects and display the totals.  i.e. go and count all the Steak_Rare totals from each sheet and display the total here dynamically.

I'm having trouble finding the right syntax for (e.g. Sheet.X!Object!Prop.Steak_Rare, or what not etc.) referencing this specific value on all the pages in order to automatically generate totals from all the manual updates to each sheet.  I've found a couple of places that mention the syntax but I cannot get it to work based on them; they are not specific, and do not give an example of a whole formula.  If I could get an example of how to create a formula that pulls a specifc value from a specific object from a specific sheet, and add them together, that would be the solution I need.

Any help here would be greatly appreciated.

JohnGoldsmith

It sounds to me like you could use a report - have you tried this?

http://office.microsoft.com/en-gb/visio-help/create-a-report-of-shape-data-HA010115465.aspx

You can embed the report in your document and add the table to your summary page.

If you really want to get into the cell reference syntax, then this chapter from DVS should set you on the right track:

http://msdn.microsoft.com/en-us/library/aa200961%28office.10%29.aspx

Let me know how you get on.

Best regards

John


John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

visio_user_5273

Yes, this is going in the right direction.  I should be able to use the data from the report (although it dumps it into a clunky embedded spreadsheet Visio shape/object, but it does the totals).

A second thing is, if I have the one shape/object like I have described above (it has properties for numbber of Steak_Rare and Steak_Med, etc. to hold counts.) How can I add a "total" property to an shape/object that will, within that one shape/object, count a total for all steaks, Steak_Rare, Steak_Med, etc. (Prop1, Prop2, etc.)?  This way users can enter each count, and the shape will total and give a count for each shape/object.

For a value you here can do a formula or sorts that adds all the others together within the single shape/object?

Thanks for the link on the reports.