News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Using dimension in formulas

Started by Panther, November 18, 2008, 09:36:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Panther

Hello, I have a problem that I'm struggling with.

I have a shape that is going to be in any one of 28 known positions.  I want to take the PinY position, rationalise it so that each vertical increase of 20mm is an increment of 1, and use that in an INDEX() funtion to return a text string from a list of strings.

e.g. 1st position is y=230mm, 2nd position is y=250mm, and so on.  To rationalise this I've used: position=IF((PinY-230 mm)=0,1,((PinY-230 mm)/20)+1 mm) (the IF statement is required to avoid dividing 0 by 20).  I would then like to use this within: INDEX(position,"a;b;c;d;e") where the string has 28 possible values.

When I try the above, the result is ALWAYS the first string in the list, regardless of position!  I've tried an alternative approach by using the MID() function and having the string without seperators, but the result is the same - ALWAYS the first letter.

Help!!!  (My only thought is that the dimension is somehow preventing the formulas from recognising it as a number).

P.S. I have also posted this in the "Shapesheets & Smart Shapes" forum as I am not sure which it should live in.

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 142 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1047KB.
Tokens: post-login.
Cache hits: 13: 0.00148s for 26,766 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]