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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
draghici1109
Creator
Creator

Concatenate Fields in LOAD command

Hello Community,

I have a task which might seems trivial for you, but for me as a rookie, is a kind of challange.

I have following file as input:

OBJID;TABSEQNR;TLINE
30001517;000001;Teamleitung, Betreuung personalwirtschaflticher EDV-Systeme
30001517;000002;SAP-HCM, E-Recruiting, Elektronische Personalakte.
30001517;000003;Arbeitszeitfragen, Personalhaushalt, Budgets, Controlling.
30001520;000001;Betreuung personalwirtschaflticher EDV-Systeme, Schwerpunkt SAP-HCM.
30001520;000002;Arbeitszeitrechtliche Fragestellungen.
30001520;000003;Aufstellung/šberwachung des Personalhaushaltes, Budgetierung.
30126423;000001;Betreuung personalwirtschaflticher EDV-Systeme, Schwerpunkt SAP-HCM.
30126423;000002;Aufstellung/šberwachung des Personalhaushaltes, Budgetierung.
30146451;000001;Betreuung personalwirtschaflticher EDV-Systeme, Schwerpunkt SAP-HCM.
30146451;000002;Aufstellung/šberwachung des Personalhaushaltes, Budgetierung.
30126424;000001;Betreuung personalwirtschaflticher EDV-Systeme, Schwerpunkt E-Recruiting,
30126424;000002;Elektronische Personalakte.
30126424;000003;Arbeitszeitrechtliche Fragestellungen.
30098733;000001;Betreuung personalwirtschaflticher EDV-Systeme, Schwerpunkt SAP-HCM.
30098733;000002;Auswertungen und Statistiken
30122059;000001;Organisationsstellenplan SAP-HCM, Statistiken
30138961;000001;Betreuung personalwirtschaflticher EDV-Systeme, Schwerpunkt E-Recruiting,
30138961;000002;Elektronische Personalakte.
30138961;000003;Arbeitszeitrechtliche Fragestellungen.
30146488;000001;Betreuung personalwirtschaflticher EDV-Systeme, Schwerpunkt SAP-HCM.
30146488;000002;Aufstellung/šberwachung des Personalhaushaltes, Budgetierung.

My goal is to concatenate the text in the column TLINE for all OBJID. For example for 30001517 I want to get a new field which is the result of the concatenation of the following texts

  1. Teamleitung, Betreuung personalwirtschaflticher EDV-Systeme
  2. SAP-HCM, E-Recruiting, Elektronische Personalakte.
  3. Arbeitszeitfragen, Personalhaushalt, Budgets, Controlling.

 

I tried the following code, which is not complete hence it just not get all three parts of the field.

 

HRV1002A1:
LOAD OBJID,
TABSEQNR,
TLINE
FROM
[..\DATA\HRV1002A.csv]
(txt, utf8, embedded labels, delimiter is ';', msq);

HRV1002ACC:
LOAD
OBJID,

if (RowNo() = 1, Text(TLINE),
if ((Previous(OBJID) = OBJID),
(Text(Previous(TLINE)) & ' ' & Text(TLINE)),
Text(TLINE))) AS Bezeichnung
Resident HRV1002A1
Order by OBJID;

 

I think I might use a variable, yet I did not figure how to use a variable in a loop (load).

Alexandru Draghici
BICC at Komm.ONE
1 Solution

Accepted Solutions
chris_djih
Creator III
Creator III

Table:
Load
  OBJID,
  Concat(TLINE, ',')  as newField
resident HRV1002A1
order by OBJID;
If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.

View solution in original post

3 Replies
chris_djih
Creator III
Creator III

Table:
Load
  OBJID,
  Concat(TLINE, ',')  as newField
resident HRV1002A1
order by OBJID;
If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.
draghici1109
Creator
Creator
Author

yet not order by but group by

Alexandru Draghici
BICC at Komm.ONE
chris_djih
Creator III
Creator III

of ccourse, i sometimes mix them up, when in a hurry 😄

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.