Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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;
i dont think thats possible.
you could use a qvs file to make changes easier
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;
You could also do this straight in the application by using concat() function on the system fields $Field and $Table.
See attached qvw
Hi,
Many Thanks for this. It is working perfect.
You are really Awesome. 😀