Using the IF function in the SolidWorks BOM
In the table-based SolidWorks Bill of Materials (BOM) equations can optionally
be used to fill in the value for cells within a column. These can be basic
mathematical equations or one can use the IF Function that is available in the
equation editor as well. An example of where this could be applied is the use of
an IF Function to control the contents of the Description column: IF the
Description value is the letter M then display the Material and if it is not M then
display the description. The equation for this would look like:
IF(`Description`="M";`Material`;`Description`) .
The items in the single quotes are custom properties that are in the part files. The
semi colons are used to separate the conditions and the output. The parentheses
bracket the entire IF Function. You can also use multiple IF statements for
something like:
IF(`Description`="M";`Material`;IF(`Description`=Purchased;`Vendor`;`Description`))
In this case, check to see if the Description is M and if it is not then check to see
if the Description is Purchased, and if it is Purchased then display Vendor
name. If Description is M then display the Material, and if it is neither of the
two values then display the Description
Other uses for this capability could be to check the quantity column and if a
number is less than 5 it could list a 5 pack, or if it is greater than 5 but less than 10
it could use a 10 pack. One might use this technique for display of purchased
parts like fasteners or bearings.