Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Concatenate Rows

Hi every one we have a typical requirement We have following data

User IDNameDevice
80004022ABDUL AZAM868438010471186
80004022ABDUL AZAM868438010471186A
80001571ABDUL AZIZ868438010470071
80001571ABDUL AZIZ868438010470071A
80001571ABDUL AZIZ868438010470071B
80001594AKHLAQ AHMED868438010470147
80001594AKHLAQ AHMED868438010470147A
80001594AKHLAQ AHMED868438010470147B
80001594AKHLAQ AHMED868438010470147C
80001591ASIM IQBAL868438010471145
80001591ASIM IQBAL868438010471145A
80001591ASIM IQBAL868438010471145B
80001591ASIM IQBAL868438010471145C
80001705IMRAN UL HASSAN868438010464702
80001705IMRAN UL HASSAN868438010464702A
80001705IMRAN UL HASSAN868438010464702B
80006221MUHAMMAD AHMED KHAN868438010467937
80006221MUHAMMAD AHMED KHAN868438010467937A
80001703RAJA TALLET IMTIAZ868438010463480
80001703RAJA TALLET IMTIAZ868438010463480A
80001703RAJA TALLET IMTIAZ868438010463480B
80000756RIZWAN MALIK868438010471046
80000756RIZWAN MALIK868438010471046A
80000745SHOUKAT IQBAL868438010465857
80000745SHOUKAT IQBAL868438010465857A

We want to show User wise all devices in one row like below

User IDNameDevices
80004022ABDUL AZAM868438010471186, 868438010471186A
80001571ABDUL AZIZ868438010470071, 868438010470071A, 868438010470071B
80001594AKHLAQ AHMED868438010470147, 868438010470147A, 868438010470147B, 868438010470147C
80001591ASIM IQBAL868438010471145, 868438010471145A, 868438010471145B, 868438010471145C
80001705IMRAN UL HASSAN868438010464702, 868438010464702A, 868438010464702B
80006221MUHAMMAD AHMED KHAN868438010467937, 868438010467937A
80001703RAJA TALLET IMTIAZ868438010463480, 868438010463480A, 868438010463480B
80000756RIZWAN MALIK868438010471046, 868438010471046A
80000745SHOUKAT IQBAL868438010465857, 868438010465857A

Is this possible? Thank you

21 Replies
rbecher
MVP
MVP

Hi Adeel,

you can use a chart with dimensions: User ID, Name     and an expression: Concat(Device)

- Ralf

Astrato.io Head of R&D
MK_QSL
MVP
MVP

Something like below..

I have only taken first few names...

Temp:

Load * Inline

[

User ID, Name, Device

80004022, ABDUL AZAM, 868438010471186

80004022, ABDUL AZAM, 868438010471186A

80001571, ABDUL AZIZ, 868438010470071

80001571, ABDUL AZIZ, 868438010470071A

80001571, ABDUL AZIZ, 868438010470071B

80001594, AKHLAQ AHMED, 868438010470147

80001594, AKHLAQ AHMED, 868438010470147A

80001594, AKHLAQ AHMED, 868438010470147B

80001594, AKHLAQ AHMED, 868438010470147C

];

NoConcatenate

Final:

Load

  [User ID],

  Name,

  Concat(Device, ', ') as Device

Resident Temp

Group By [User ID], Name;

Drop Table Temp;

The above example is for SCRIPT side but if you want at Expression and UI end..

You can use the same Concat (Device, ', ') in expression.

sunilkumarqv
Specialist II
Specialist II

use cross table in your script edtior itshelp you ..

see  sample.

Crosstable (User ID, Name) Load * from ex1.csv;

ashwanin
Specialist
Specialist

Hi Adeel,

User Concat(Device,',') in the expression.

refer the qv attached for this.

Not applicable
Author

Thank you Ralf,

But actually we want to Load our desire result from script just because of we have bulk of data and due to this data add more lines.

Not applicable
Author

Great Manish it works. But as i said earlier we have huge Data more than 10M and due to Group By function Dashboard execute in more time.

rbecher
MVP
MVP

But then you will lose that level of detail (granularity)..

Astrato.io Head of R&D
Not applicable
Author

Hmmm...

You are right in some scenario but in our case we just need to now which User have multiple and which Devices.

and i think it will serve.

Thank you

MK_QSL
MVP
MVP

Dear Adeel,

Working on Script end will take more time to reload data but if you choose to work the same on

UI side, it will severely affect your processing time.

I always prefer to work on Script side more rather than on UI.

You can try to use both ways and find out which one is giving better result.