Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
ashish_2511
Creator
Creator

Concatenate all values of a single key value to one delimited value.

Hi Community

Didn't know how to put up the heading but here's the sample data. Given below are the input table and the expected output table. Please suggest a way to achieve this.

 

InputOutput
RegionDataRegionData
APAC1APAC1,2,5
APAC2EMEA3,4,7
EMEA3LATAM6,8
EMEA4
APAC5
LATAM6
EMEA7
LATAM8

 

Thanks!

Sneh

1 Solution

Accepted Solutions
vishwa_461
Contributor III
Contributor III

Hi Patnaik,

Please try the below script.

Table1:

LOAD * INLINE [
region, data
APAC, 1
APAC, 2
EMEA, 3
EMEA, 4
APAC, 5
LATAM, 6
EMEA, 7
LATAM, 8
]
;


NoConcatenate


table2:
load region,
Concat(data,',') as data
Resident Table1
group by region;


drop table Table1;

View solution in original post

9 Replies
vishwa_461
Contributor III
Contributor III

Hi Patnaik,

Please try the below script.

Table1:

LOAD * INLINE [
region, data
APAC, 1
APAC, 2
EMEA, 3
EMEA, 4
APAC, 5
LATAM, 6
EMEA, 7
LATAM, 8
]
;


NoConcatenate


table2:
load region,
Concat(data,',') as data
Resident Table1
group by region;


drop table Table1;

View solution in original post

Anil_Babu_Samineni

May be using this expression in Object

Region as Dimension

And Expression is This


concat(distinct Data,',',Data)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
sdmech81
Specialist
Specialist

Hi,

Please find attachment ur data is loaded in inline and showed.

used like  =aggr(Concat((Data),','),Region)

Thanks

vishwa_461
Contributor III
Contributor III

Hi Patnaik,

Use the same expression without distinct. It works.

Take Region as Dimension and Expression is concat( Data,',')

vishwa_461
Contributor III
Contributor III

You Should not add Data again.

tamilarasu

Hi Snehasis,

Script Solution:

Input:

Load Region, Concat(Data, ',') as Data Group by Region;

LOAD * INLINE [

    Region, Data

    APAC, 1

    APAC, 2

    EMEA, 3

    EMEA, 4

    APAC, 5

    LATAM, 6

    EMEA, 7

    LATAM, 8

];

Front End Solution:

Straight/Pivot table

Dimension

Region

Expression

Concat(Data,',')

Capture.PNG

ashish_2511
Creator
Creator
Author

Thanks Sachin. I consider this to be the best solution from a front end perspective.

Regards

Sneh

ashish_2511
Creator
Creator
Author

Thanks! Nagaraj

I personally consider this to be the best solution from a back-end perspective.

Regards

Sneh

ashish_2511
Creator
Creator
Author

Thank you all for your valuable comments. I've got my answer

Regards

Sneh