Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I have 2 tables as stated below
table1:
Id Name
1 A
2 B
3 C
table2:
Id
1,2,3
I am able to separate the comma separated values in table2 by using Subfield. but the Name corresponding to select table Id column comes out as only 'A'. However, it should reflect as 'A','B','C'. Kindly suggest the solution.
Hi,
try like this,
Table1:
load *,SubField(id,',') as Id;
load * Inline [
id
1,2,3
];
drop Field id from Table1;
Table2:
load * Inline [
Id, Name
1, A
2, B
3, C];
I believe Inline table reads commas as column separator. If you replace commas with a pipe or something else, then it will work. Try this:
Table1:
LOAD *,
SubField(id,'|') as Id;
LOAD * Inline [
id
1|2|3
];
DROP Field id from Table1;
Table2:
load * Inline [
Id, Name
1, A
2, B
3, C];
Hi,
another example:
table1:
LOAD * Inline [
Id Name
1 A
2 B
3 C
] (delimiter is spaces);
table2:
LOAD SubField(Id,',') as Id, SomeFact
Inline [
Id SomeFact
1,2,3 fact1
1,2 fact2
1,3 fact3
2 fact4
4,5 fact5
](delimiter is spaces);
hope this helps
regards
Marco