Hello, not sure what i am doing. I have basic computer programming skills from college 15 years ago.
I am trying to create a smart label using expressions. I want to label a structure the following based on inner diameter
< = 1200, i want the label to display 701.010
>1200 & < = 1500, i want the label to display 701.011
etc
This is what I came up with but it won't work
IF(({Inner Structure Diameter}<=1200,701.010),IF({Inner Structure Diameter}>=1200&<=1500,701.011))
I have research on line but not sure I understand fully. If we can get one to work we can use this type of labeling in other formats.
Any suggestions
Solved! Go to Solution.
Solved by fcernst. Go to Solution.
I don't think you can nest IF statements.
Make one exp for < and another for >. Bothe return a Space character if false, the diameter if true.
In the labels style have two componets. Both display but only the true staement will display text.
John Mayo
Try this
IF(({Inner Structure Diameter}<=1200,701.010),701.011)
Or in pseudocode if Inner St Dia <=1200 then 701.01 else 701.011
You might be able to nest if statements, and if so
IF({Inner Structure Diameter}<1200,701.010,IF({Inner Structure Diameter}=1200,701.011,701.012))
If Inner St Dia <1200 then 701.01, elseif Inner St Dia = 1200 then 701.011 else 701.012 (when St Inner Dia >1200)
IF({Inner Structure Diameter}<=1200,701.010,IF({Inner Structure Diameter}<=1500,701.011,”Out of Range”))
Hi Fred, thanks for taking the time help,
Does this work for you? I am getting a the following error.
parse error, undefined symbol "Out
I think I need an out of range expression?
Hi Eric, funny I worked with an Eric Collins in Alberta in the Oil Patch. Thanks for taking the time to respond.
I can't seem to get the expression to return any value but 701.010. I just copied and pasted yours and it still only returns 701.010 no matter what the inner structure width is.
What value do you want to return if your diameter is out of this range?
IF({Inner Structure Diameter}<=1200,701.010,IF({Inner Structure Diameter}<=1500,701.011,701.012))
It still only returns 701.010. I checked the parts list and the diameters are all different.
Thanks anyways.
Yes, it works for me.
I am in Imperial units, so my structure diameters are in inches and I am using feet in testing this expression now.
What happens if you change your 1200 to 1.2 and your 1500 to 1.5 (for meters)?
IT WORKS. Your Genius. Thank you so much.
As I slowly poor you a beer and cheers.
BTW, I prefer to build formulae like this in Excel as it is easier to test there and get all the parentheses straight...