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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
draghici1109
Creator
Creator

concat works randomly

Hello,

I have to concatenate several records in one field using the concat() function. Yet concat works somehow randomly and concatenate the records not sorted but randomly. Here is the code:

prepTLINE:
NoConcatenate
LOAD
    TABNR,
    num#(SubField(TABSEQNR, '0', -1)) AS NumTABSEQNR,
TLINE
FROM HRT1002.qvd] (qvd);
 
draghici1109_0-1745824446807.png

 

 
prepMappingTLINE:
NoConcatenate
LOAD
    TABNR,
    NumTABSEQNR,
TLINE
Resident prepTLINE
order BY TABNR,NumTABSEQNR ASC;
 
STORE prepMappingTLINE into prepMappingTLINE.qvd] (qvd);
 
DROP Table prepTLINE;
 
// Step 3: Create mapping table using sorted QVD
SortedTLINE:
NoConcatenate
LOAD
    TABNR,
    NumTABSEQNR AS TABSEQNR,
    TLINE
Resident prepMappingTLINE
ORDER BY TABNR, NumTABSEQNR;
 
mTLINE:
Mapping
LOAD
    TABNR,
Concat(TLINE, ' ') AS AllTLINE
RESIDENT SortedTLINE
GROUP BY TABNR;
 
----
Here is the end result: 
 
draghici1109_1-1745824502532.png

 

 
Opens in new window
PDF Download
Word Download
Excel Download
PowerPoint Download
Document Download
 

 

 
Opens in new window
PDF Download
Word Download
Excel Download
PowerPoint Download
Document Download
 
Alexandru Draghici
BICC at Komm.ONE
Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

You need only to specify the third (numeric) parameter of:

concat(Field/Expression, Delimiter, Sort)

 

View solution in original post

2 Replies
marcus_sommer

You need only to specify the third (numeric) parameter of:

concat(Field/Expression, Delimiter, Sort)

 
draghici1109
Creator
Creator
Author

thanks! I apologize... one should read the help files 

 

 
Opens in new window
PDF Download
Word Download
Excel Download
PowerPoint Download
Document Download
 
Alexandru Draghici
BICC at Komm.ONE