Skip to Content

Formula to extract string values from concatenated column value

Hello everyone,

I am trying to make formula where I have to break my data into parts on specific occurrence of characters. I worked on a formula and succeed in breaking the column in to new line. Now I want to extract these break lines of text to use it further. I tried making the formula where my left first record is extracting before the character '-' for multiple row its not picking the second left first value.

For example :

my column: 1.00000-50000000.00000 : 50.00 |

on breaking : 1.00000-

50000000.00000:

50.00

but when my column value exceeds

my column : 1.00000-50000000.00000 : 50.00 | 50000001.00000-150000000.00000 : 70.00 |

on breaking : 1.00000-

50000000.00000 :

50.00

50000001.00000-

150000000.00000 :

70.00

its not picking the next first left value:

Formula on left I am using :

whileprintingrecords;

stringvar MANG_FEE := cstr({ds_MngFeeComm.MANGE_FEE});

stringVar y := Replace(Replace(Replace(MANG_FEE,'-','-'+CHR(10)),'|',CHR(10)),':',CHR(13));

extractstring(y,'','-');

formula on right I am using :

whileprintingrecords;

stringvar MANG_FEE := cstr({ds_MngFeeComm.MANGE_FEE});

stringVar y := Replace(Replace(Replace(MANG_FEE,'-','-'+CHR(10)),'|',CHR(10)),':',':'+CHR(13));

Please help.

Split.jpg (87.5 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 10, 2015 at 09:55 PM

    Hi,

    Use this function ChrW() instead of CHR().

    --DJ

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.