Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
We are having a field as supplierid like 'ACD-2464788',DBG-6437665555,CND-765322456 and so on.
Here we need to find only supplierid start with ACD and DBG and after that we need to add -1156 for ACDsupplier at end and -4324 at end
The final output will look like
Supplier ACD:
2464788-1156
Supplier DBG:
6437665555-4324
Thanks..
Try this
load if(left(supplierid ,3) = 'ACD'
,mid(supplierid ,5)&'-1156'
,mid(supplierid ,5)&'-4324') as newsupplierid
From datatable
where left(supplierid ,3) = 'ACD' or left(supplierid ,3) = 'DBG' ;
regards
Try this
load if(left(supplierid ,3) = 'ACD'
,mid(supplierid ,5)&'-1156'
,mid(supplierid ,5)&'-4324') as newsupplierid
From datatable
where left(supplierid ,3) = 'ACD' or left(supplierid ,3) = 'DBG' ;
regards
you can try using wild card in the script
Perhaps this? I haven't test this due to software not installed in my client space
Table_Name:
Load FieldName, SubField(FieldName, '-', 1) as First_FieldName,
SubField(FieldName, '-', 2) as Second_FieldName
Where WildMatch(FieldName, 'ACD*', 'DBG*');
Load * Inline [
FieldName
ACD-2464788
DBG-6437665555
CND-765322456
];
Final:
NoConcatenate
Load FieldName, First_FieldName, Second_FieldName, Pick(Match(First_FieldName, 'ACD', 'DBG'), Second_FieldName & '-1156', Second_FieldName & '-4324') as FieldName_Copy
Resident Table_Name;
Drop Field FieldName;
Rename Field FieldName_Copy to FieldName;
Drop Table Table_Name;
Any other approach.
Thanks..
Hi
anil's approach should work. Did you try it ? If you are not satisfied kindly share some sample data with output which will help us help you .
I've seen atleast more than 20 threads who owner of thread. Fortunately, you never come up with the end up result where you need to get So finally, When you say second approach i would ask to explain little more
Hi,
I have checked it but it give only 'FieldName' which is in Inline.
Thanks..
Add your table in place of inline table in the preceding load.
Inline is the sample data he has taken.
regards
Pradosh
Working copy
Note - Please mark correct answer for exact result and mark as helpful for others ..