conditional statement problem

conditional statement problem

Anonymous
Not applicable
2,106 Views
17 Replies
Message 1 of 18

conditional statement problem

Anonymous
Not applicable

Hi there....

There is something that looks a little bit nonsense in my area schedule.

 

I am scheduling different type of units such as flat, maisonette and multi-storey house. Since either maisonette and house areas are spread on different levels I've created a formula to calculate the total number of units correctly. i.e. a duplex has a total area which is the sum of the two areas on two different floors and so, needs to be counted as 1 (area) instead of 2.

 

I've assigned a value equal to the number of levels the area is spread on and then make the grand total.

 

Here the formula: if(LEVEL=3,1/3,if(LEVEL=2,1/2,if(LEVEL=1,1,0))).

Where LEVEL is an input assigned to each area.

 

Then, I want to calculate the total number of RENTED units and I did the same process, but this time I combine a RENTED VALUE created like LEVEL.

 

Here the weird thing, as I attached, the values per row are correct only if I don't make any calculation at the bottom. As soon as I calculate the total all value would change.

 

Any idea about what I am doing wrong?

 

Many thanks

0 Likes
Accepted solutions (1)
2,107 Views
17 Replies
Replies (17)
Message 2 of 18

ToanDN
Consultant
Consultant

@Anonymous wrote:

Hi there....

There is something that looks a little bit nonsense in my area schedule.

 

I am scheduling different type of units such as flat, maisonette and multi-storey house. Since either maisonette and house areas are spread on different levels I've created a formula to calculate the total number of units correctly. i.e. a duplex has a total area which is the sum of the two areas on two different floors and so, needs to be counted as 1 (area) instead of 2.

 

Why don't you use Unit Name or Number assigned to Areas to count the units?  If you do that, it doesn't matter if an unit's areas spread on different levels, they are still identified as one unit.

 

 

I've assigned a value equal to the number of levels the area is spread on and then make the grand total.

 

Here the formula: if(LEVEL=3,1/3,if(LEVEL=2,1/2,if(LEVEL=1,1,0))).

Where LEVEL is an input assigned to each area.

 

Then, I want to calculate the total number of RENTED units and I did the same process, but this time I combine a RENTED VALUE created like LEVEL.

 

Here the weird thing, as I attached, the values per row are correct only if I don't make any calculation at the bottom. As soon as I calculate the total all value would change.

 

Any idea about what I am doing wrong?

 

Many thanks


 

0 Likes
Message 3 of 18

Anonymous
Not applicable

Why don't you use Unit Name or Number assigned to Areas to count the units?  If you do that, it doesn't matter if an unit's areas spread on different levels, they are still identified as one unit.

 

Names are already assigned to areas. But Revit doesn't calculate total name. In addition, that wouldn't solve the issue when I need to pick up information whichever unit's information and the relative unit to make a total. Does it make sense?

 

As I showed, it looks particularly odd that the calculation changes as soon as I make a total of the source.

0 Likes
Message 4 of 18

ToanDN
Consultant
Consultant

Not sure why your formula is so complicated.  It can be as simple as below:

 

Capture.PNG

0 Likes
Message 5 of 18

Anonymous
Not applicable

I would just say that your formula is more clever than mine.Smiley Wink

 

Apart from that, I've tried your formula but the problem is still there. If you make a total from your UNIT COUNT's column the total would be wrong.

Perhaps, I haven't explained my problem well. The trouble is about making total, not the formula itself...

 

Many thanks

 

0 Likes
Message 6 of 18

ToanDN
Consultant
Consultant

The reason is when you enter the Number of Level for a grouped Unit, you actually enter the value for all the rows of that Unit.  So when you calculate total, the value is not the same.  I will get back to this later.

 

Capture.PNG

0 Likes
Message 7 of 18

ToanDN
Consultant
Consultant

Here is another approach.  See the attached 2017 Revit file for formulas and settings.

 

Capture.PNG

0 Likes
Message 8 of 18

Anonymous
Not applicable

ToanDN, thanks so much for explaining.

 

I've attached two grand total calculations. The first one uses a formula I had set up before consulting the forum, the second one uses the one you suggested. When I select calculate totals the first one gives me the correct total whereas the second count each item as you said and so the total is wrong.

 

Sorry for bothering you, but I can understand why the first one works and the second doesn't.

 

Thanks in advance

 

 

0 Likes
Message 9 of 18

ToanDN
Consultant
Consultant
Same explanation as above. If you set the schedule to itemized every row you will understand. Nonetheless, i have change my suggestion to a different approach.
Message 10 of 18

Anonymous
Not applicable

Thanks for that....it'd take me a little bit more to understand it anyway.

Smiley Frustrated

0 Likes
Message 11 of 18

ToanDN
Consultant
Consultant

So you last example works, how come the one you posted initially did not?

0 Likes
Message 12 of 18

Anonymous
Not applicable

I've no idea, that's the thing!

I thought it was something like "Revit doesn't allow to make a calculation from another calculation"...I'll have a look at my massive schedule and get back to you.

 

Many thanks for now

0 Likes
Message 13 of 18

ToanDN
Consultant
Consultant

I think if you itemize every row, enter 1 as the number of Level for every row, then un-itemize, the total count will be correct with your formula.

 

See attached screenshots and Revit file:

 

Capture.PNGCapture1.PNGCapture2.PNGCapture3.PNG

0 Likes
Message 14 of 18

FAIR59
Advisor
Advisor

I would suggest an alternative approach:

Use a yes/no parameter to indicate the main entrance level (only 1 for each unit) and use a formula to convert it into 0 or 1 for the unit count.

 

UnitCount1.PNG

 

and  in the schedule you can use the Count parameter to get the number of internal levels per unit:

 

UnitCount2.PNGUnitCount3.PNGUnitCount4.PNG

 

Message 15 of 18

Anonymous
Not applicable

That sounds great, thanks so much!

 

it would possibly work around the calculation problem.

However, I am just wondering whether, working as a team, it may be a bit confusing. (i.e. everybody needs to know that only one of the area would be included in the schedule and be careful when create/delete them).

 

I am about to create a template with a default schedule to avoid all these problems. By the way, that is a great shout!

 

Going back to the previous suggestions, yesterday I tried again the others solutions and sometimes was fine sometimes it wasn't. I start thinking that there would be a sort of bug in Revit 2017

 

Many thanks 

0 Likes
Message 16 of 18

FAIR59
Advisor
Advisor

all the areas will be included in the schedule. Users have to check the IsMainEntranceLevel parameter for 1 area per Unit, and uncheck the others. 

Message 17 of 18

ToanDN
Consultant
Consultant
Accepted solution

I added the Count field to the schedule (thanks to @FAIR59 suggestion), set it to Not calculate total, then the whole thing works as you asked without having a Yes/No parameter.  The total units are correct, the levels per unit are correct, the areas are correct.

 

Capture.PNG

 

 

 

 

Message 18 of 18

Anonymous
Not applicable

Brilliant, it looks great!

Many thanks for your help

0 Likes