Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Concatenate values in different columns into One Column


Hi,

I have a table that looks like this.

ColumnAColumnBColumnCColumnD
ADCF
BE-G
CA-H
-B--

I want to append ColumnA followed by ColumnB followed by ColumnC followed by ColumnD, and the final "ResultColumn" must look like:

ResultColumn.jpg

I understand in QlikView it is not possible to display same values twice under one column. In that case the final "ResultColumn" may look like this

ResultColumn
A
B
C
D
E
F
G
H

I tried concatenate, but it puts all values in once cell, which is wrong. Concatenate looks like this: ABCDEFGH

I appreciate your response.

Thanks,

R

1 Solution

Accepted Solutions
sunny_talwar

Take a look at the attached code and application:

Temp:

LOAD ColumnA,

    ColumnB,

    ColumnC,

    ColumnD

FROM

[https://community.qlik.com/thread/159869]

(html, codepage is 1252, embedded labels, table is @1);

Table:

LOAD ColumnA as ResultColumn

Resident Temp

Where ColumnA <> '-';

Concatenate (Table)

LOAD ColumnB as ResultColumn

Resident Temp

Where ColumnB <> '-';

Concatenate (Table)

LOAD ColumnC as ResultColumn

Resident Temp

Where ColumnC <> '-';

Concatenate (Table)

LOAD ColumnD as ResultColumn

Resident Temp

Where ColumnD <> '-';

TableFinal:

LOAD RowNo() as Key,

  ResultColumn

Resident Table;

DROP Tables Temp, Table;

View solution in original post

4 Replies
sunny_talwar

Try it like this:

Table:

LOAD ColumnA as ResultColumn

Resident XYZ;

Concatenate (Table)

LOAD ColumnB as ResultColumn

Resident XYZ;

Concatenate (Table)

LOAD ColumnC as ResultColumn

Resident XYZ;

Concatenate (Table)

LOAD ColumnD as ResultColumn

Resident XYZ;

HTH

Best,

Sunny

sunny_talwar

Take a look at the attached code and application:

Temp:

LOAD ColumnA,

    ColumnB,

    ColumnC,

    ColumnD

FROM

[https://community.qlik.com/thread/159869]

(html, codepage is 1252, embedded labels, table is @1);

Table:

LOAD ColumnA as ResultColumn

Resident Temp

Where ColumnA <> '-';

Concatenate (Table)

LOAD ColumnB as ResultColumn

Resident Temp

Where ColumnB <> '-';

Concatenate (Table)

LOAD ColumnC as ResultColumn

Resident Temp

Where ColumnC <> '-';

Concatenate (Table)

LOAD ColumnD as ResultColumn

Resident Temp

Where ColumnD <> '-';

TableFinal:

LOAD RowNo() as Key,

  ResultColumn

Resident Table;

DROP Tables Temp, Table;

Not applicable
Author

Hi SunIndia,

I applied to your script to my original code and it works. Thanks for your promt response.

Thanks,

Raghu


sunny_talwar

Hey Raghu, I am glad I was able to help.

Have a good one.

Best,

Sunny