cancel
Showing results for 
Search instead for 
Did you mean: 

Need to split column data into two columns based on data

Former Member
0 Kudos

I need to split data from one existing columns into two display columns based on a field's data when Left(field,2) <>16 the data needs to be displayed in column A, whereas Left(field,2)=16 needs to be displayed in column B.

I have tried creating two new objects in the universe that use the field as the source data, but have been unable to find a way that lets me do a left() function on the data in this field.

Is there another way to do this that I am missing, or is there a function I can use to do this comparison in the universe?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi john,

As Yuvraj says is right,

if you are using a variable is string then you have to match with LEFT(field,2)<>"16" or ="16".

if your filed is number then you have to first convert it to string then using left function and then try it out for split column.

Thank You,

Haresh

Former Member
0 Kudos

Hi John,

The functions available at universe level are specific to the Database you are using.

-- Could you please provide BO version + Database version?

-- Also, can you please update on the DATA TYPE of [field] object as Left function is used on Strings and you are trying to compare it with numeric value i.e. 16.

If [field] is a String then try Left([field],2) <> '16' or ='16' -- passing 16 as string with single codes.

Else try,

CAST (Left([field],2) as number(2)) = 16 -- converting the field to number before comparing.

NOTE: functions used above are specific to teradata database. Please use the similar functions specific to your database.

-- Also try to share error message if any

Hope it will help in some way.

Regards,

Yuvraj

wmarcy
Contributor
0 Kudos

In Web Intelligence it's called "Left" function for a string but if you want to the same thing in the universe side, you'll have to use "LTRIM" I imagine.

In universe you have to use Database function and not Web Intelligence function.

former_member189638
Active Contributor
0 Kudos

Can you please explain with some example on what you are trying to achieve?? Also May I know what is the error that you are getting??

Hope the field is a Character string and not number because I believe  Left function can only be used for a String.

And did you try achieving this at the WebI end??