Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
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
Partner

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
Partner

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

Vegar
Partner
Partner

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

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
khalander
Creator II
Creator II
Author

Hi,

 

Many Thanks for this. It is working perfect. 

You are really Awesome. 😀