ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
BJBrad Jordan25/04/2016

Alright if there's any code wizards out there I've got one for you.  For our BOMs we show a length column, which for most items doesn't apply to most electrical components except for din rail and wiring duct.  Does anyone know a way to return a blank value or empty cell if the BOM length is zero?

We show the length in inches and the default formula was STR (bom_length / 25.4, 10, 2).  Not sure what exactly the 10, 2 is for at the end but that is how SWE had this set up to show length in inches and it works (also works without the 10, 2 at the end).

I tried a simple IIF statement: IIF(bom_length > 0, STR(bom_length / 25.4, 10, 2), "").  To no avail, the zeros are still there. Even if I put text in between the quotations I still get a zero back on the BOM.  I'm not a coder and I'm hoping someone will be able to answer this one pretty easily.