Back to zzTakeoff Community Channel LogoFeature Requests

Switch Function

Under Review

It would be great for formulas if a Switch function was available. For example, instead of using a nested if function for rebar size, a switch function would return values much more efficiently.


Nested if function works like this:

If([Rebar Size]=4,.667,If([Rebar Size]=5,1.05,If([Rebar Size]=6,1.5,....etc)))


If the Excel Switch function was available it would be reduced to this:

Switch([Rebar Size],4,.667,5,1.05,6,1.5,7,2.04....)


Switch is much easier to evaluate. And cleaner to read when writing formulas. The value [Rebar Size] in this case can be controlled with a dropdown selection limiting the input to accepted values for the Switch Function.

1

Hi David, I love it!

I am not sure if you know it, but you can also reduce the math by using a rebar product list. This way the rebar weight and diameter can be selected when you choose the size.

see below. If you need to see this in action, email me at todd@zztakeoff

I started with the nested formula and this just seemed easier.

I have the vendor and material class properties as well so I can separate the rebar in a report.

hope this helps.


Good Morning Todd,


I got the product list to work, seems like a neat way to do it.


Only complaint I have, unless I did it wrong, is that I created a custom variable, applied it to products and items called rebar weight. So the different rebar types show up with a weight property per lf. But that means there is a rebar weight variable that shows up for all items as well, even if the item has nothing to do with rebar.


1) the switch function would make a item specific custom variable easy.

2) is there a way to have custom properties apply to products only and leave the items out?


Thanks!

@David another way to represent:


If([Rebar Size]=4,.667,If([Rebar Size]=5,1.05,If([Rebar Size]=6,1.5,....etc)))



is to use:


[Rebar Size] == 4 ? 0.667 : [Rebar Size] == 5 ? 1.05 : [Rebar Size] == 6 ? 1.5 : ...


The nice thing about this is it doesn't require parentheses that stack at the end like the first formula.

You must be logged in to post replies. If you don't have an account you can signup here.