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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
TJane1641356540
Contributor
Contributor

Get result of query as variable for each iteration

I have a tdbinput which uses a select query like "select A,B,C from test"

I am trying to store the extracted values per each iteration from the database table into a context variable so i can use it later using tjava or tjavarow.

I tried using tsetglobalvar in the flow like:

TDBINPUT-main-->TSETGLOBALVAR---main--->TJAVAROW

iterate does not work above,it only accepts main row for each connection

But when i use context,it only retains the latest value,i would want for each

iteration

the results to get stored and processed?

My tjavarow has:

context.Atest=input_row.A;

What is the correct way to extract and store in context for each row in the database

Labels (7)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Use a tFlowToIterate component here. It will store each row's columns in the globalMap and iterate from that component. Everything that follows that component will fire completely for each row of data. The globalMap keys will be in the format....

 

{row name}.{column name}

 

So a String from "row1" with a column name of "myVal" will be retrieved like this....

 

((String)globalMap.get("row1.myVal"))

 

 

View solution in original post

1 Reply
Anonymous
Not applicable

Use a tFlowToIterate component here. It will store each row's columns in the globalMap and iterate from that component. Everything that follows that component will fire completely for each row of data. The globalMap keys will be in the format....

 

{row name}.{column name}

 

So a String from "row1" with a column name of "myVal" will be retrieved like this....

 

((String)globalMap.get("row1.myVal"))