Announcements
The way to achieve your own success is the willingness to help somebody else. Go for it!
cancel
Showing results for
Did you mean:
Contributor II

## Looking for Multiple Values

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.

1 Solution

Accepted Solutions
Master

Input:
Col1, place

1,Area

1,Club

2,District

3,Country

3,Street
];

TAB2:
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;

11 Replies
Partner - Specialist

Hi @Saro_2306, what about the Concatenate function?

``````Load
A,
A & ' - ' & Concatenate(B, ',') AS MyOutput
Resident Input
Group By A;``````

JG

Master

HI,

Try below code

Input:
A, B

1,Area

1,Club

2,District

3,Country

3,Street
];

Output:

Resident Input Group by A;

drop Table Input;

Contributor II
Author

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.

Partner - Specialist

Have you tried the Concatenate function, this is what it does, it concatenates Area and Club in the same result.

JG

Contributor II
Author

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.

Master

Input:
Col1, place

1,Area

1,Club

2,District

3,Country

3,Street
];

TAB2:
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;

Contributor II
Author

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.

Master

Try Below Script

LOAD SubField(PLACE,'-',1) &'-'& SubField(SubField(PLACE,'-',2),'/') as PLACE;
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).

Contributor II
Author

Sorry bro, It is not working.

Community Browser