If Statements

How To Use “If” Statements

Overview:

If statement are used to turn an item On or Off depending on whether or not the item meets specific criteria. There are many different cases in which you can accomplish something with just a single line item by using “If” statements, where you might have required several line items without the “If” statement. There are other times in which you would not be able to setup certain criteria to turn on automatically if you did not have “If” statements available

Some examples of when “If” statements prove useful:
· “If” statements are used by interior contractors to automatically figure heights for lifts or scaffolding based on the wall height. Or.
· “If” statements are used by roofing contractors to automatically figure whether to use asphalt or cold process materials, it also decides whether the material is order by tons or gallons.

Setup:

“If” statements are created from existing items in a Group or by creating an Item and adding it to a Group, “If” statement are created in an item’s CQty field. Depending on your level of expertise with the EDGE this step can be performed in either the Items screen of the Group Database or the Items screen in a job.

Additional Examples:

What follows are examples of how “If” statements could be used. For the “Interior Contractor” scaffolding for walls up to 12’, 12’ to 16’ and 16’ to 24’.

You will need to begin with a scaffolding item. The next step is to find a CQty (C Quantity) you can use for the quantity. In this case you can use the CQty of SFR, which is the Square Feet of Framing. After you have selected the CQty you then need to find a tilde code that will work with the CQty, in other words it needs to know when to turn on and when to turn off automatically. In this example the tilde code ~SCL~ or Stud Cut Length is the logical choice since it tells us the height of the wall. The height of the wall determines whether scaffolding is needed or not. The next step is to write an “If” statement that says if the Stud Cut Length is less than 12 ft then turn this line on and if the Stud Cut Length is greater than 12 ft keep this line turned off. Below is an example of what this statement would look like.

The CQty of SFR would have produced the same answer without the “If” statement, however, the “If” statement checked to see if the statement was true or false it was true therefore the line turned on. Look at the table below to learn how to read the statement. IFL(~SCL~,12,1,0).

Where:

IFL = If Less Than.
~SCL~ = Match Tilde Code “Stud Cut Length”.
12 = Stud Cut Length set in the Conditions’ properties screen.
1 = If the statement is true.
0 = If the statement is false.

Look what happen to the line when we go back to the condition properties and set the Stud Cut Length to 14 ft.

When the stud length was changed to 14 ft it no longer met the criteria and the “If” statement turned the line off.

Setup Example:

The simplest way to create “If” statement is to build the state from within a test job after creating the statement and testing it you can then save it back to the Group Database.

Drywall
1.Create and open a Test Job, create a test Page and then proceed to the Conditions screen and insert a Partition Group.
2.Set up the condition for a test wall, set the Stud Length to 11’ 0”. Click OK.
3.Go to the Drawing screen and digitize a room 10’ X 10. Click OK.
4.Click the Items Tab and open the Item List screen.
5.Mark the Stud line and then click on the Copy+Insert icon. The stud is copied and inserted directly below the original.
6.Highlight the new line and then click on the Properties icon NOT the Cond Prop icon. The Item Properties screen opens .

7.Click in the Description field and Delete the existing description. Now type the word Scaffolding in the Description.
8.Next move down to the CQty field and the light bulb at the end of the field. The CQty/Tilde Builder opens. The current CQty of NST (Number of studs and segment terminators) is highlighted. Remember we want to use a CQty of SFR (Square Feet of Framing). Drag the vertical slide on the right side of the window upwards. The very first CQty is SFR click on it and highlight it.
10.Click OK and return to the Item Properties Window.

11.The first thing to be done is to change the Estimated Unit from LF to SF. Then with your mouse, click on the Calculations Tab at the top of the window.
12.On the Calculations screen fill-in both the Order Unit and Price Unit field. Set both of these fields to SF. Click OK when finished, you are returned to the Items List Screen. The Scaffolding should be turned on now and black in color.

13.“If” statements are also used in the roofing industry, the EDGE uses “If” statements to determine whether to turn asphalt or adhesive on for an estimate. The principle and the procedures are exactly the same.

For example a Built Up roof uses hot asphalt to mop the plies in place at an average rate of 30 pounds of asphalt per ply per square whereas a cold apply system uses on average 2.5 gallons of adhesive per square. Without an “If” statement it would require multiple groups or perhaps conditions to easily create a solution as both roof systems use the same roof area condition for their base and ply calculations.

The following examples demonstrate how “If” statement solve this dilemma.

Built Up Roofing:

Two Type IV Plies with 1 SBS Cap using hot mopped asphalt at 30 lbs/Sq of Type III Asphalt.

Here you can see that the asphalt has been set up at a coverage rate of 30 Lbs/Sq. A roof has been measured at 10,000 SqFt. If we go to the Items screen and look at the Asphalt line we will see:

Take Notice of the two “If” statements being used here, one for the Mid Plies and one for the Cap Ply. The “If” statement is the same for both lines but the CQty is different, that is due to the fact that base, mid and cap plies all have their own CQty.

Regardless the same setup procedures are used, find the correct C quantity and tilde match code then add the criteria. If we look at the CQty/Tilde Builder for this line we see:

In the first example we used the “If” statement to turn scaffolding on or off, here we are using the statement to turn on and off the correct Type of asphalt or adhesive and to calculate the correct quantity of the right material. This “If” statement is as follows:
NPA2*IFL(~AP~,10,0,1).

Where:
NPA2 = Number of pounds of asphalt for Inter-Plies
IFL = If Less Than
~AP~ = Match Tilde Code – Asphalt Pounds (30)
10 = 10 Units
0 = 0 if the statement is false
1 = 1 if the statement is false
OR
If 30 is less than 10 turn this item off, this statement is false so the item it turned on.

Cold Applied Roof System:

Estimate a BURmastic 3 Ply Cold Applied roof system using 2.5 gallons of adhesive per ply per square
Here you can see that the adhesive has been set up at a coverage rate of 2.5 Units/Ply/Sq. Using the same roof as previously measured at 10,000 SF. If we go to the Items screen and look at the Asphalt line we will see:

Since adhesive is being use on the base plies there is only one line or one “If” statement. Once again the same setup procedures are used, find the correct C quantity and tilde match code then add the criteria. If we look at the CQty/Tilde Builder for this line we see:

This “If” statement reads as follows:
NPA1*IFL(~AP~,10,10,0,1)
Or
If 2.5 is less than 10 turn this item on

A while back when the scaffolding example was started we specified three different scaffolding setups, walls to 12’, walls 12’ to 16’ and walls 16’ to 24’. We’ve finished with the walls to 12’ now we’ll look at the other two heights.

The next statement deals with walls from 12’ to 16’ or if the Stud Cut Length is greater than or equal to 12’ and less than 16’ turn this statement on but if it is not equal to either of these parameters then leave then line off.

The following is an example of how this can be set up. The CQty still just gives us the quantity of scaffolding required, it is going to require the use of two “If” statements to meet and satisfy the parameters we desire (greater than 12’ but less than 16’).

The two “If” statements are set up as follows:
SFR*IFGE(~SCL~,12,1,0)*(~SCL~,16,1,0)

Where:
The first statement reads:

And the second statement reads:

In the first statement we are saying IF the stud cut length is greater than or equal to 12ft then take the SFR times 1 to give us a positive number that will turn this line ON, and if the statement is false then take SFR times 0 therefore turning this line OFF. Then we also have to consider the second If statement which is saying IF the stud cut length is less than 16ft then take the SFR times 1 to give us a positive number that will turn this line ON and if the statement is false then take the SFR times 0 therefore turning this line OFF.

This means, that if one of these statements is false then the entire statement is false and the line will be turned off but, if both statements are true the line will remain on.

Learn, Network and More at Our User Conference: CONVERGE24!