Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
brunopaulo
Partner - Creator II
Partner - Creator II

Concatenate 2 fields

Hi community,

I have table A like this

TableA:
Load

FieldA,
FieldB,

From...

Concatenate(TableA)
Load

FieldC,

FieldD,

From...

I wanna create a key with fieldA and fieldC, how can i do?

Thank you for the help.

Best Regards,

Bruno Paulo

1 Solution

Accepted Solutions
devarasu07
Master II
Master II

Hi,

You can try like this,

TableA:

LOAD * INLINE [

    FieldA, FieldB

    A, 1

    B, 2

    C, 3

    D, 4

    E, 5

];

Concatenate(TableA)

LOAD * INLINE [

    FieldC, FieldD

    G, 8

    H, 27

    I, 30

    K, 17

    Z, 11

];

Final:

load *, FieldA &'|'& FieldC as %Key Resident TableA;

Drop table TableA;


Thanks,Deva

View solution in original post

5 Replies
YoussefBelloum
Champion
Champion

Hi,

basically to create a key you can do this: fieldA&'_'&fieldC as KEY

but you should have the fieldA and the fieldC on both tables..

brunopaulo
Partner - Creator II
Partner - Creator II
Author

exactly my problem, field A is on table A and field C is on table B. Im concatenating the tables for single table but i need dat key.

devarasu07
Master II
Master II

Hi,

You can try like this,

TableA:

LOAD * INLINE [

    FieldA, FieldB

    A, 1

    B, 2

    C, 3

    D, 4

    E, 5

];

Concatenate(TableA)

LOAD * INLINE [

    FieldC, FieldD

    G, 8

    H, 27

    I, 30

    K, 17

    Z, 11

];

Final:

load *, FieldA &'|'& FieldC as %Key Resident TableA;

Drop table TableA;


Thanks,Deva

PabloOrtiz
Partner - Creator
Partner - Creator

Hello Bruno, try something like this

TableA:

Load

FieldA,

FieldB,

From...

Concatenate(TableA)

Load

FieldC,

FieldD,

From...

rename TableA to _TableA;

TableA:

load *, FieldA & '.' & FieldB as KEY resident _TableA;

drop table _TableA;

brunopaulo
Partner - Creator II
Partner - Creator II
Author

Thank you, perfect. I was searching for this