Standard text functions not working (?)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-03-18 11:48 AM
Hi,
We seem to be having a super weird error with a very simple function using mid / len / trim.
The function is validated (by clicking on validate) and 'evaluate expression' gives out the correct result in process/object studio, every time (on multiple computers, with different settings etc.)
However, when run outside of process/object studio, it always produces an error - 'failed to evaluate expression (...) - unexpected ) in parameters'
The function is super simple (attached a pic as well)
Mid(Trim([dataItem1]), "1", (Len(Trim([dataItem1]))/2))
Any ideas?
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
14-03-18 04:40 PM
Could the divide by 2 be producing a non-integer value?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-03-18 02:34 PM
No, since the length of the string is always bigger than 1 (and can't be empty).
I couldn't find any solution and attempted something stupid - I moved this from write stage to calculation stage, passed the value to a data item and used said data item in the write stage instead.
That fixed the issue, so it seems to be a bug in BP.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-03-18 06:22 PM
I meant could it be possible that x/2 is not producing a whole number, eg 3/2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
25-04-18 02:27 PM
Replace ""1"" with 1 and try.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
18-06-18 07:01 PM
Had the same issue with expression ""01-Jan-""&FormatDate(AddMonths(Today(); 12); ""yyyy"") in write stage.
error message : Syntax error. The token '(' is invalid. Please check the case of your operators (eg 'or' versus 'OR') and check that your functions use brackets after the function name eg Now(), eg Len(""abc"").
Validation shows its working fine, the solution with move the expression to calc stage too... so just wonder what could be the issue.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
13-08-18 06:25 PM
Check you regional settings and ensure that number formats do not use commas for decimal, separators etc. I saw similar behaviour and from what I could tell the inclusion of commas in value passed causes the text parser to expect a parameter.
