Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
h_prakash
Contributor

Concatenate Two Values of a Field in the Load Edit Script

Hi All,

I have a two fields, Project Number and Path, For One project number there may be one to many Path's. I have a requirement in Qlik Sense where I have to create a table in which All the path's should be concatenated  by ' , ' specific to Project Number.

Now it is

Project Number      Path

1                         Path 1

1                         Path 2

2                         Path 1

2                         Path 2

2                         Path 3

According to the requirement

Project Number            Path

1                                 Path 1, Path 2

2                                 Path 1, Path 2, Path 3

I have tried Concat Function in the front end and I am able to achieve the above requirement. But there are many fields that I need to concat

and it is taking  2-3 min for the table to appear.

So I am thinking of concatenating the values in the load edit script.

I have tried using Concat function in edit script along with group by clause but it throwing error.

Please help.

4 Replies
rittermd
Honored Contributor

Re: Concatenate Two Values of a Field in the Load Edit Script

Can you provide the code you are using in the script and what the error is?

h_prakash
Contributor

Re: Concatenate Two Values of a Field in the Load Edit Script

Hi Mark,

Thank you for the response. Concat with Group by is working. Initially I have applied group by to only one field. Now I have applied to other fields and it is now working.

Thanks

Hari

rahulpawarb
Valued Contributor III

Re: Concatenate Two Values of a Field in the Load Edit Script

Hello Hari,

Trust that you are doing well!

Please use below given script for your reference:

TmpPath:

LOAD * INLINE [

Project Number, Path

1, Path 1

1, Path 2

2, Path 1

2, Path 2

2, Path 3

];

Path:

LOAD [Project Number],

     Concat(Path, ',') AS NewPath

Resident TmpPath

Group By [Project Number];

Drop Table TmpPath;

Also refer the sample application file attached herewith.

Hope this will be helpful.

Regards!

Rahul

h_prakash
Contributor

Re: Concatenate Two Values of a Field in the Load Edit Script

Thanks Rahul..!!