Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Saro_2306
Contributor II
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
sasikanth
Master
Master

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;

 

View solution in original post

11 Replies
JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @Saro_2306, what about the Concatenate function?

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

JG

sasikanth
Master
Master

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;

Saro_2306
Contributor II
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. 

JuanGerardo
Partner - Specialist
Partner - Specialist

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

JG

Saro_2306
Contributor II
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.

sasikanth
Master
Master

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;

 

Saro_2306
Contributor II
Contributor II
Author

@sasikanth 

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. 

sasikanth
Master
Master

 

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).

Saro_2306
Contributor II
Contributor II
Author

Sorry bro, It is not working.