Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to give parameter as an input to qlikview document in SQL?

HI,

Please help on this option.

I need to give parameter as an input to the qlikview document.

Ex : Load EmpName,Salary;

     SQL select EmpName,Salary from EMP where Salary >= '$Parameter';

I need to give parameter externally.

6 Replies
shantanu73
Creator II
Creator II

Hi Guru,

This is very good question. Even I also want the solution for this problem. It will be great thanks if any body give the solution ASAP.

Anonymous
Not applicable
Author

As i see it, the parameter has to be read into qlikview before you can execute the sql statement.

A solution could be to store the parameter in a txt-file and then let qlikview read from this file an store the result in a variable.

If your parameter is dynamic, and defined in sql tables, you can create an sql statement to get the parameter result, and store that value in a varable.

You can then use the variable as a parameter in the sql statement.

Henrik

Anonymous
Not applicable
Author

Hi Henrik,

Many thanks for prompt reply.

So in this case I need to update text file when ever I need to reload the document.

Don't we have any option like after hitting the "Reload" button, QlikView Document should ask to enter parameter?

Anonymous
Not applicable
Author

In that case you can create an input box and maintaine the value of the variable in the inputbox.

The variable stored from an inputbox can be used in the script and in a SQL statement.

Henrik

Not applicable
Author

Hello

You can use the spécial $(variable) command in your SQL Querry. Exemple for loading from a schema all table name.

SET vFieldName = 'MyTableName';

SET vDbSchema = 'MySchemaName';

MyTableList:

SQL  SELECT tablename as "$(vFieldName)"

         FROM pg_tables

         WHERE schemaname = '$(vDbSchema)';

Miguel_Angel_Baeyens

Hi,

Check this thread on the subject, to get the user prompted when reloading.

Hope that helps.

Miguel