Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Experts,
I need your help in the below task.
I have a field which is in the below format.
AAA1|AAA2|AAA3
AAA2|AAA1|AAA3|AAA4
AAA4|AAA3|AAA1
I want to create a manual field like below
AAA1
AAA2
AAA3
AAA4
and then when I select AAA1 it should select my original field.
Kindly help
Thanks & Regards
Jeba
No need for load inline. If your have your OriginalField loaded form the database or any data source, only the seconf part is relevant. The essence of the solution is the subfield() function which breaks the OriginalField intothe separate parts.
Hi,
like this
load * ,left(Field,4) as NewField;
LOAD * Inline
[
Field
AAA1|AAA2|AAA3
AAA2|AAA1|AAA3|AAA4
AAA4|AAA3|AAA1
];
Regards
ASHFAQ
Jeba,
If I got your question right, this should work:
data:
load * inline [
OriginalField
AAA1|AAA2|AAA3
AAA2|AAA1|AAA3|AAA4
AAA4|AAA3|AAA1
];
New:
load distinct
OriginalField,
subfield(OriginalField, '|') as NewFeild
resident data;
Regards,
Michael
Hi Ashfaq,
Thanks for the message.
However my field length is not fixed.The only delimiter is |
Also I have one more clarification in the Inline statement.
My database has many fields including the one which I want to filter.
still shall I use Inline?
Regards
Jeba
Hi,
If it is not fixed, then use below code shown for NewField1.
load * ,left(Field,4) as NewField,
Left(Field, Index(Field, '|') - 1) as NewField1;
LOAD * Inline
[
Field
AAA1|AAA2|AAA3
AAA2|AAA1|AAA3|AAA4
AAA4|AAA3|AAA1
];
Yo can apply the same while loading from database.
Regards
ASHFAQ
Hi Michael,
Thanks for the help.
Your logic is correct.Since I have many fields in my table do I need to write a separate inline statement exclusively for this field and also the fields are not fixed.It can be a any type of combination but we have a delimiter |
Actually this is separate requirement which I just received from my requestor.
I build everything properly,but matching this by a new field is where I struck up.
Kindly help
Thanks & Regards
Jeba
Hi if you solution is what Michael suggest.
No need to worry about length.
you can create separate field while loading from database itself.
Regards
ASHFAQ
No need for load inline. If your have your OriginalField loaded form the database or any data source, only the seconf part is relevant. The essence of the solution is the subfield() function which breaks the OriginalField intothe separate parts.
Hi Michael,
Thanks a lot
It worked.
Thanks & Regards
Jeba