Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
khalander
Creator II
Creator II

How to concatenate all available fields into single field in qlikview

Hi,

 

Currently in my data source i have 8 fields available. I want to concatenate all fields into single field. i can do that by using & symbol. But in future if they add another new field it should concatenate automatically. Please do the needful.

 

Thanks,

Khalander

Labels (1)
1 Solution

Accepted Solutions
jmmolero
Partner - Creator
Partner - Creator

Hi,

You can generate a variable with the concatenated field and then use it with a resident load of original table:

DUMMY_TABLE:
LOAD * INLINE [
F1, F2, F3
a, 1, 2
];


let vConcatenateFields='';

FOR i = 1 to NoOfFields('DUMMY_TABLE')

Let vFieldName = FieldName(i ,'DUMMY_TABLE');

Let vConcatenateFields = '$(vConcatenateFields)' & '&$(vFieldName)';

NEXT i

//Drop initial '&'
Let vConcatenateFields = Mid('$(vConcatenateFields)',2);


DUMMY_TABLE_CONCATENATE:
LOAD $(vConcatenateFields) as concatenate_field,
*
Resident DUMMY_TABLE;

DROP Table DUMMY_TABLE;

View solution in original post

4 Replies
blueran
Contributor II
Contributor II

i dont think thats possible.

you could use a qvs file to make changes easier

jmmolero
Partner - Creator
Partner - Creator

Hi,

You can generate a variable with the concatenated field and then use it with a resident load of original table:

DUMMY_TABLE:
LOAD * INLINE [
F1, F2, F3
a, 1, 2
];


let vConcatenateFields='';

FOR i = 1 to NoOfFields('DUMMY_TABLE')

Let vFieldName = FieldName(i ,'DUMMY_TABLE');

Let vConcatenateFields = '$(vConcatenateFields)' & '&$(vFieldName)';

NEXT i

//Drop initial '&'
Let vConcatenateFields = Mid('$(vConcatenateFields)',2);


DUMMY_TABLE_CONCATENATE:
LOAD $(vConcatenateFields) as concatenate_field,
*
Resident DUMMY_TABLE;

DROP Table DUMMY_TABLE;

Vegar
MVP
MVP

You could also do this straight in the application by using concat() function on the system fields $Field and $Table.

 

Vegar_1-1596610650551.png

 

See attached qvw

khalander
Creator II
Creator II
Author

Hi,

 

Many Thanks for this. It is working perfect. 

You are really Awesome. 😀