Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
It;s urgent.I tried a lot but i didnt get it:
a string has many charcters :
1st 35 charcters into one field but should complete a word .
ex: the premium life insurance corporate company which has a filed name NM
it comes:
left(NM,35)
result:
the premium life insurance corporat into NM1
e company into NM2
but i want
the premium life insurance into NM1
corporate company into NM2
pls help.Thanks in advance
Can you try this:
Tried this?
Table:
LOAD *,
Left(Field, 35) as OldNM,
Trim(If(Len(Field) <= 35, Field, Left(Field, (Index(Left(Field, 36), ' ', -1))))) as NM1,
Trim(If(Len(Field) <= 35, '', Right(Field, (Len(Field) - (Index(Left(Field, 35), ' ', -1)))))) as NM2 ;
LOAD * Inline [
Field
the premium life insurance corporate company
];
Hi uma,
use mid function instead of left. i.e mid(NM,27).
see attached for the script.
Thanks
Krishna
Try this script:
Table:
LOAD *,
Left(Field, (Index(Left(Field, 35), ' ', -1))) as NM1,
Right(Field, (Len(Field) - (Index(Left(Field, 35), ' ', -1)))) as NM2 ;
LOAD * Inline [
Field
the premium life insurance corporate company
];
Output
sunindia ur script not working excatly how i want
krishna can u write script in here i cant open .qvw file outside (restricted in office)
anybody script here pls
tab_tmp:
load * inline [
NM
the premium life insurance corporate company
];
tab:
LOAD
NM ,
mid(NM,27) as [NM 1]
resident tab_tmp;
drop table tab_tmp;
Try this:
Table:
LOAD *,
Left(Field, 35) as OldNM,
If(Len(Field) <= 35, Field, Left(Field, (Index(Left(Field, 36), ' ', -1)))) as NM1,
If(Len(Field) <= 35, '', Right(Field, (Len(Field) - (Index(Left(Field, 35), ' ', -1))))) as NM2 ;
LOAD * Inline [
Field
the premium life insurance corporate company
];
this NM is a field name which has 7,000 columns with different number of chacters.not specific to this.
the premium life insurance corporate company is just example.
post the qvw with just some sample data and the common requirement on that column.
is there any way we can write it in expression in straight table
as i said i have a table with 7,000 records in that i am pulling NM field and dividing it into NM1,NM2
by using (set analysis) expression.
PLs help
Did you try the new script?
Table:
LOAD *,
Left(Field, 35) as OldNM,
If(Len(Field) <= 35, Field, Left(Field, (Index(Left(Field, 36), ' ', -1)))) as NM1,
If(Len(Field) <= 35, '', Right(Field, (Len(Field) - (Index(Left(Field, 35), ' ', -1))))) as NM2 ;
LOAD * Inline [
Field
the premium life insurance corporate company
];
If it works on the back end, you should be able to use the same in the straight table as expressions also.
HTH
Best,
Sunny