Revit Schedules: Take the sum of grouped values

Revit Schedules: Take the sum of grouped values

luis_brionesalonso
Advocate Advocate
12,485 Views
13 Replies
Message 1 of 14

Revit Schedules: Take the sum of grouped values

luis_brionesalonso
Advocate
Advocate

Hi everybody,

 

I've been having some trouble getting a certain calculated parameter in Schedules. I have a Schedule that is sorted by parameter Length_1. The Schedule is grouped by this parameter. What I want to achieve is to calculate the sum of each unique value for this parameter. So If I have 3 instances with Length_1=300, and 5 instances with Length_1=500, I want to have a calculated parameter Length_total that has a value of Length_total=800, but I am at a bit of a loss as to how to pour this into a formula. 

I have added a simplified sample file with rebar as an example, since the practical application would be for calculations in Rebar Schedules. 

 

PS: I am specifically looking for a way to do this in Revit Schedules. I know it can be done easily in Dynamo but I would like to avoid having to run a script to achieve this.  

 

0 Likes
Accepted solutions (1)
12,486 Views
13 Replies
Replies (13)
Message 2 of 14

barthbradley
Consultant
Consultant

I'm not sure I understand. Do you mean this:

 

Calc1.pngCalc2.png

0 Likes
Message 3 of 14

luis_brionesalonso
Advocate
Advocate

No, that would take the sum of all instances, I am looking for a way to take the sum of each unique value without taking into account the amount of instances of Rebar that have that value. Whether it is 5 instances of Length_1=200 and 7 instances of Length_1=400, or if it is 8 instances of Length_1=200 en 4 instances of Length_1=400, I want the calculated parameter to just give me Length_Total(=200+400)=600.

 

I hope that makes it clear.

0 Likes
Message 4 of 14

barthbradley
Consultant
Consultant

@luis_brionesalonso wrote:

 I want the calculated parameter to just give me Length_Total(=200+400)=600.

 

 


 

I'm sorry, I'm still not following. A calculated parameter will create another COLUMN. That column will calculate a value for EACH INSTANCE.  But what it sounds like you want, is what I'm showing above -- TOTALS.  

 

 

0 Likes
Message 5 of 14

luis_brionesalonso
Advocate
Advocate

The purpose of the calculated parameter is to be used in other formulas. I am aware that calculated parameters are applied to each instance. The value per instant is however not relevant since I am only interested in the total value.

 

I don't know how it can be achieved precisely (obviously), but the formula for the calculated parameter could (I presume) be split amongst each instance so that the total value would add up to what I described above, so that I can use it in another formula. 

 

e.g. 3 instances A with Length_1=300 and 4 instances B with Length_1=500 would result in Length_Total=300/3=100 for each instance of A, and Length_Total=500/4=125 for each instance of B, resulting in Length_Total having a total value of 800 (in other words the sum of each unique value for Length_1). I could not make this work myself so I assume there are some steps that I am missing, which led me to make this thread 🙂 

 

Hopefully this clears it up. Otherwise I am afraid my original question is going to get derailed too much so best to not go into it any deeper.  

 

0 Likes
Message 6 of 14

barthbradley
Consultant
Consultant

hmm? I didn't know there would be Quadratic Equations on this test. Let me think about it...

 

Quadratic Equations 2.png

 

😉

 

 

Message 7 of 14

Mirko.Jurcevic
Collaborator
Collaborator

@luis_brionesalonso wrote:

 

I don't know how it can be achieved precisely (obviously), but the formula for the calculated parameter could (I presume) be split amongst each instance so that the total value would add up to what I described above, so that I can use it in another formula. 

 

e.g. 3 instances A with Length_1=300 and 4 instances B with Length_1=500 would result in Length_Total=300/3=100 for each instance of A, and Length_Total=500/4=125 for each instance of B, resulting in Length_Total having a total value of 800 (in other words the sum of each unique value for Length_1). 


It looks simple but the main problem is total number per grouped instances is calculated at the same time as the total length, or any other total. You get totals only after schedule is created, meaning that there should be "second run" which will then use that total.

 

It can't be done automatically, using the tools and formulas in Revit schedules.

 

It can be done either by using Dynamo which will write information about total number of certain instances into that instances, or manually by adding additional instance parameter, showing that number in schedule, then manually copying instances count into this parameter, and then the formula will use this number to divide length and sum it to get "false total".

I hope you get what I mean.

If this solved your issue, please Accept it as Solution help other forum users with similar issues to find answers easily.
  
Mirko Jurcevic


My blog: www.engipedia.com
Try my Revit add-ins: Autodesk App Store
0 Likes
Message 8 of 14

ToanDN
Consultant
Consultant

See attached.

 

ToanDN_0-1591685398491.png

 

0 Likes
Message 9 of 14

luis_brionesalonso
Advocate
Advocate

Hi ToanDN, Thank you for your answer. If I understand correctly this mean there is no fully automatic way to achieve this and I have to manually turn the YES/NO parameter to YES for one instance for each unique value? 

 

I feel like if there was a way to get a parameter that can automatically assign the total number of instances with the same Length_1 value to each individual instance I could divide Length_1 by this parameter to get the same result automatically, but I am getting the feeling this isn't possible then...

0 Likes
Message 10 of 14

ToanDN
Consultant
Consultant
Precisely.
0 Likes
Message 11 of 14

luis_brionesalonso
Advocate
Advocate
Accepted solution

I have found a workaround I believe. I have added a Count (workaround) parameter and used it to to create a percentage parameter of Count (workaround) by Length_1 which apparently gives the percentage of 1/number of instances for each unique value (did not expect that). I can then multiply Length_1 with that percentage to achieve the desired result. 

 

credit where credit is due, found the idea on this forum thread: https://revitforum.org/showthread.php/26581-total-mayhem

Length_1 SUM .png

 

0 Likes
Message 12 of 14

Mirko.Jurcevic
Collaborator
Collaborator

I told you. Either Dynamo, or manual input.

 

You could do it with one manual additional parameter ("total number of instances" in a group) and one "calculated length" value which will divide instance Length with "total number of instances", but in the end (Total) will be equal to the length of single instance in that group.

If this solved your issue, please Accept it as Solution help other forum users with similar issues to find answers easily.
  
Mirko Jurcevic


My blog: www.engipedia.com
Try my Revit add-ins: Autodesk App Store
0 Likes
Message 13 of 14

luis_brionesalonso
Advocate
Advocate

I guess the wording in my last response was bad, when I described the added Count (workaround) parameter, I was talking about a calculated value defined in the schedule with the formula equal to one. 

 

That way there is no manual input required and it is all defined in the schedule and then calculated automatically. I of course appreciate your response and help but I don't feel like what you suggested is the same as this. There are no instance parameters added here and there is no manual copying of values or any manual input.

 

Regardless, thank you for your help and suggestion.

0 Likes
Message 14 of 14

Mirko.Jurcevic
Collaborator
Collaborator

No, the problem was in me, I did not test your solution.

You are right, guess I learned something new today.

🙂

If this solved your issue, please Accept it as Solution help other forum users with similar issues to find answers easily.
  
Mirko Jurcevic


My blog: www.engipedia.com
Try my Revit add-ins: Autodesk App Store