Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
taz803
Contributor III
Contributor III

Creation of composite key

hello i should create a composite key with 8 colonne :

select 

col 1 , col 2, col 3 , col 4 , col 5 , col 6 , col 7 , col 8

from table 

i try col1 & '-' & col2 .... its doesn't work

i try also Field1&'|'&Field2 as Key its doesn't work

Can someone help me to get a solution

Labels (6)
3 Replies
Chanty4u
MVP
MVP

May be give a try 

Load

    Concat(col1, '-', col2, '-', col3, '-', col4, '-', col5, '-', col6, '-', col7, '-', col8) as CompositeKey

From YourTable;

taz803
Contributor III
Contributor III
Author

you can not concat 8 colonne .. concat accept only 2 fields ...

marcus_sommer

In general you could combine multiple fields with an approach like:

col1 & '-' & col2 as Key

at least within Qlik and within a sql-query it should mostly the same. A look in the help from the data-base will list which operators and quotes are allowed for it.

Therefore take a look that the syntax is right and the fields are spelled correctly. If this didn't help you should provide what happens - any error or the result and why the result isn't what you are expecting?