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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Ven6
Contributor III
Contributor III

Query parameter in file

hello dear all
I have a problem I would like to configure a query so that the parameters of the query are in a file on my computer.

I use a tAS400Row and the query is as follows: select * from table where date =? and name = '?'
I would like them? be read to a file on my computer.

 

plz help.

Labels (2)
2 Replies
manodwhb
Champion II
Champion II

Read the parameters in a file and read using tfileinputdelimited and then use tflowtoiterate component after that use tAS400row and with the global variable of tflowtoiterate construct the query.
TRF
Champion II
Champion II

Construct the query as a sting like this:

"select * from table where date = " + (String)globalMap.get("theDate") + " and name = '" + (String)globalMap.get("theName") + "'"

 

Global variables theDate and theName must be pupulated after reading the file where the values are:

tFileInputDelimited-->tFlowToIterate

For tFlowToIterate, untick the option "Use the default (key, value) in global variables"  the add 2 rows to define these variables or let the option as is and use the autogenerated names such as row1.theDate and row.theName.