cancel
Showing results for 
Search instead for 
Did you mean: 

truncate numbers from string field

Former Member
0 Kudos

Afternoon all,

This time I'd like to extract only 2 strings out of a string field. The field is of sales area which contains numbers and letters. For example, Scotland is given a number 01, West midlands is 02, Ireland however is given IR.

however, the field which holds the information is like, 012, where 01 is the area number and 2 is type of area number.

The information which we are interested in is first two strings.

I have tried this in the formula given below but it doesn't work, it states a field is required


If hasvalue({?Sales Area}) then
totext(Minimum({slslsp.slr_slsperson}[1 to 2])) + " - " +
 totext(Maximum({slslsp.slr_slsperson}[1 to 2]))
else
"n/a"

Should I be using a truncate and if yes then how?

P.S. This is to show only the sales area number or text if selected under a parameter. The values of the parameter will stay the same. In other words it is just to show in the report.

Many thanks once again

Regards

Jehanzeb

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Is it a range parameter? If so try this

If hasvalue({?Sales Area}) then
totext(Minimum({slslsp.slr_slsperson})[1 to 2]) + " - " +
 totext(Maximum({slslsp.slr_slsperson})[1 to 2])
else
"n/a"

regards,

Raghavendra.G

Edited by: Raghavendra Gadhamsetty on Jan 16, 2009 4:16 PM

Former Member
0 Kudos

Raghavendra I found it after moving the [1 to 2] after brackets and then your message came ).

Thanks 10 stars for you!

Regards

Jehanzeb

Answers (0)