Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
sculptorlv
Creator III
Creator III

Complex concatinate

Hello!

I have the following data:

Table:1

Agent_Name Group_Code

Alex                    Delta

Anna                   Delta

John                   Alfa

Simon                Alfa

How can I use QLIK LOAD in order to gen an additional column Group_Name:

Table_to_be_created:

Group_Code   Group_Name

Delta                       Alex and Anna

Alfa                         John and Simon

Thank you in advance!

1 Solution

Accepted Solutions
avkeep01
Partner - Specialist
Partner - Specialist

Table1:

Agent_Name,

Group_Code

FROM Table1;

LEFT JOIN (Table1) LOAD

Group_Code,

CONCAT(Agent_Name,' and ') AS Group_Name

RESIDENT Table1

GROUP BY Group_Code;


View solution in original post

5 Replies
avkeep01
Partner - Specialist
Partner - Specialist

In this case you'll need a join instead of a concatenate.

Table1:

Agent_Name,

Group_Code

FROM Table1;

LEFT JOIN (Table1) LOAD

Group_Code ,

Group_Name

FROM Table2

sculptorlv
Creator III
Creator III
Author

Sorry, I wasn't very precise,

I don't have a Group_Name column and I need to create it.

avkeep01
Partner - Specialist
Partner - Specialist

Table1:

Agent_Name,

Group_Code

FROM Table1;

LEFT JOIN (Table1) LOAD

Group_Code,

CONCAT(Agent_Name,' and ') AS Group_Name

RESIDENT Table1

GROUP BY Group_Code;


sculptorlv
Creator III
Creator III
Author

Thank you for help! It works with slight modification!

My exact code is:

SQL_AGENT_TEAMS:

LOAD

Team_Code,

CONCAT(Employee_Code, ' and ') AS Team_Name

RESIDENT SQL_AGENT_TEAMS

GROUP BY

Team_Code;

vishsaggi
Champion III
Champion III

may be try this?

Grouping:

LOAD * INLINE [

Agent_Name, Group_Code

Alex, Delta

Anna, Delta

John, Alfa

Simon,Alfa

];

NoConcatenate

Final:

LOAD Group_Code,

     Concat(Agent_Name, ' and ') AS Group_Name

Resident Grouping

Group By Group_Code;

Drop table Grouping;