Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have some paths are there in field,
like
path:
abcdjhjhjfgjf\snsbnsb\ajkdjjhjhf\
jhsdhfjdhfjh\dd\sdd\dfdfd\
jhjdhfjdh\f\sd\
dfd\hg\rtrtr\ee\e
My Req is i want retrive upto to second '\' only in all the data.hw to achive this?
ex:
abcdjhjhjfgjf\snsbnsb
jhsdhfjdhfjh\dd
jhjdhfjdh\f
dfd\hg
regards,
kd
Have a look at the Subfield() function.
subfield(your_data, '\', 1) & '\' & subfield(your_data, '\', 2)
Have a look at the Subfield() function.
subfield(your_data, '\', 1) & '\' & subfield(your_data, '\', 2)
SubField(FieldName,'\',1) & '\' & SubField(FieldName,'\',2) as NewFieldName
SubField(path, '\', 1) & '\' & SubField(path, '\', 2)
This should also work for you:
=Left('abcdjhjhjfgjf\snsbnsb\ajkdjjhjhf\', (Index('abcdjhjhjfgjf\snsbnsb\ajkdjjhjhf\', '\', 2)-1))
Replace abcdjhjhjfgjf\snsbnsb\ajkdjjhjhf\ with your field name
HTH
Best,
Sunny
In the script, you can use this:
Table:
LOAD Path,
Left(Path, (Index(Path, '\', 2)-1)) as NewPath
Inline [
Path
abcdjhjhjfgjf\snsbnsb\ajkdjjhjhf\
jhsdhfjdhfjh\dd\sdd\dfdfd\
jhjdhfjdh\f\sd\
dfd\hg\rtrtr\ee\e
]
Output:
Thanks to all,
all are expressions working perfectly.