Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vchuprina
Specialist
Specialist

How can I merge data from a few columns in one column

For example I have following table:

A                       B                  C

                      

Delivery            Color            StyleDesc

Dept                 ColorDesc    Store

Manufacturer     Style            StoreNumber

I want to merge  3 columns into one column, like this:

   D

Delivery           

Dept                

Manufacturer

Color     

ColorDesc

StyleDesc      

Store

StoreNumber

Please advise the best way

Thanks,

Vitaliy

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
3 Replies
rubenmarin

Hi Vitaliy, this script creates a D field with those values:

LOAD SubField(A &';'& B &';'& C, ';') as D;

LOAD *

Inline [

A,B,C

Delivery,Color,StyleDesc

Dept,ColorDesc,Store

Manufacturer,Style,StoreNumber

];

Anonymous
Not applicable

use concat

load A as D

from ...

concatenate load B as D  (word concatenate not necessary as will be automatically concatenated by same fieldname D)

from ...

concatenate load C as D

from ...

sebastianlettner
Partner - Creator
Partner - Creator

Hi,

you could use this code. It loads every column from a table into a single column and you don't have to write a load statement for each column.

Base:

LOAD * INLINE

[

A, B, C

Delivery, Color, StyleDesc

Dept, ColorDesc, Store

Manufacturer, Style, StoreNumber

];

for i=1 to NoOfFields('Base')

    Let FieldName = FieldName(i, 'Base');

   

    Target:

    LOAD

        $(FieldName) as Field

    Resident Base;

   

next i;

Regards

Sebastian Lettner