on 11-18-2008 3:23 PM
i have a string field (bill to name)
i would like to take the following and foll it up to one value
abc industries
abc international
abc industries international
i would like them to all be grouped by ABC
i have tried
if instr({string field},"/")>0 then
split({string field},"/") [1]
i receive an error THIS ARRAY MUST BE SUBSCRIPTED for example ARRAY <i>,
im a bit confused can anyone tell me how to get this to work please, not familar with arrays.
Hi Sharon,
I'm not exactly sure what it is you are trying to do but your formula is erring out because of the subscript in the last line.
You can't subscript a function. Are you trying to get the first character from the split? It should look like:
StringVar X;
X := split({string field},"/");
X [1];
Next, what you described and what your formula are doing is confusing. Your formula is looking for "/" but I don't see any in your example.
Can you explain what you mean by rolling the records into one value? Are you trying to append them together or just group based on the "abc"?
To group them create a formula like:
If {string.field} [1 to 3] = "abc" Then
"abc"
Else {string.filed};
Now you should be able to group on this formula.
Good luck,
Brian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am trying to capture the companies that have the 1st or 2nd word in the string the same
i have 3 companies
ABC INT.
ABC INDUSTRIES
ABC VENTURES
DFGRH COMPANY
DFGRH INDUSTRIES
JOE SMITH VENTURES
JOE SMITH CAPITAL
i would like to be able to create a formula to capture the first and / or 2nd word of the string.
i tried
StringVar X;
X := split({string field},"/");
X [1];
it returns null values
Hi Sharon,
Got it. So you want to group the companies based on part of their names.
This is where it gets more complicated than you might have expected. For companies ABC and DFGRH it would be simple because their names only have 2 words. Include JOE SMITH and now you need to figure out which combination of the 3 words you want to group on.
Try this then:
If InStr ({table.FIELD}, " ") Then
{table.FIELD} [1 to InStr ({table.FIELD}, " ")]
Else {table.FIELD}
Unfortunately I took the easy road out but this will search for the first space in the string then parse out everything up to the space.
Good luck,
Brian
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.