Help With using a value from a field in an expression

A

Aj

So i am trying to do a division, by taking a value from a drop down field and
using it within an expression field in a formula ...
(substring(my:field1, 0, 4)/(12))..so I am extracting the first 4 characters
of the string which is a number such as 1.0 and diving that by 12. It gives
me the following error :

Node Test Expected.
substring(my:field1,0,4)/->12<-

I understand this might be due to the fact that I am taking a
string(although its a number) and diving that by a number?
Your assisstance is much appreciated.
 
S

S.Y.M. Wong-A-Ton

Use the number() function around the substring() expression to make sure that
you're dealing with a number. I think the zero in your substring expression
should be a 1. Furthermore, if you have the XPath Advanced checkbox on use
div instead of a slash. Make sure you enter spaces around the slash (I've
found this to solve such errors in the past).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top