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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Combining Multiple rows returned by a SQL statement into a string

I have a tMySQLInput that returns multiple rows. In each of these rows is information that when combined will create the where clause of a SQL statement. How can I combine the multiple rows returned from the SQL statement into one string.
Thank You
Scott
Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi Scott
You can concatenate all rows on a tJavaFlex component, for example:
tMysqlInput--row1--tJavaFlex
in the begin part of tJavaFlex, define a empty string, eg:
String s="";
in the main part of tJavaFle, concatenate all the rows returned from tMysqlInput, for example:
if(s.equals(""){
s=row1.name;
}else{
s=s+";"+row1.name;
}
//name is a column name on tMysqlInput;
in the end part of tJavaFlex, put the string to a global variable so that you can use it on other component later. For example:
globalMap.put("key", name);

Let me know if you still have problems!
Best regards
Shong