Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

nnellore
New Contributor II

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
New Contributor III

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

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.

henrikmatz
Contributor II

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

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

nnellore
New Contributor II

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

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?

henrikmatz
Contributor II

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

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

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

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)';

MVP
MVP

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

Hi,

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

Hope that helps.

Miguel

Community Browser