Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Consider below table,
Input:
A, B
1,Area
1,Club
2,District
3,Country
3,Street
Output:
While looking for Values 1 - Area, Club 2 - District, 3 - Country, Street as like i need multiple values as output.
Anybody can help. Thanks in Advance.
Input:
load * Inline [
Col1, place
1,Area
1,Club
2,District
3,Country
3,Street
];
TAB2:
Load * Inline [
Col1
1
2
3
];
Output:
mapping Load Col1, Concat(place,',') as place
Resident Input Group by Col1;
drop Table Input;
FINAL:
Load Col1, ApplyMap('Output',Col1,'N/A') as Col2 Resident TAB2;
Drop Table TAB2;
Hi @Saro_2306, what about the Concatenate function?
Load
A,
A & ' - ' & Concatenate(B, ',') AS MyOutput
Resident Input
Group By A;
JG
HI,
Try below code
Input:
load * Inline [
A, B
1,Area
1,Club
2,District
3,Country
3,Street
];
Output:
Load A, Concat(B,',') as place
Resident Input Group by A;
drop Table Input;
I think you guys are misunderstood my question. I need to lookup values. Apply map function gives 1st value as output. But i need show all possible values. Thats is what i represent as 1 - Area and Club.
Have you tried the Concatenate function, this is what it does, it concatenates Area and Club in the same result.
JG
My actual file contains 2 table. Table 1 having data like table Input. Table 2 having unique values. (I.e 1, 2,3). In table 2 i need to show output values, as like i mentioned above, in separate column.
Column 1 | Column 2
1 | Area, Club
2| District
3| Country, Street.
Will you script gives my output.
Input:
load * Inline [
Col1, place
1,Area
1,Club
2,District
3,Country
3,Street
];
TAB2:
Load * Inline [
Col1
1
2
3
];
Output:
mapping Load Col1, Concat(place,',') as place
Resident Input Group by Col1;
drop Table Input;
FINAL:
Load Col1, ApplyMap('Output',Col1,'N/A') as Col2 Resident TAB2;
Drop Table TAB2;
My Source having Data like this
1 - Area / Country
2 - District
3 - Country / Street.
And My Output should be like below.
1 - Area,
1 - Club
2 - District
3 - Country
3 - Street.
How to Change Script. Can you help me. Thanks in advance.
HI @Saro_2306
Try Below Script
LOAD SubField(PLACE,'-',1) &'-'& SubField(SubField(PLACE,'-',2),'/') as PLACE;
Load * Inline [
PLACE
1 - Area / Club
2 - District
3 - Country / Street.
];
EXIT SCRIPT;
(note: You may need to make necessary modifications to the script according to format).
Sorry bro, It is not working.