Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Input variables before loading

Dear specialits,

Is it possible to let the load script with input variables?

What I want is that when you open the Qlikview document there will be a input filed to fill in the variable.
Then make a Load-button, when you press the button the loaad script will be using the variabel.

Example:

Input vYear = 2009

And then use vYear in the loadscript like :

Load *
SQL SELECT
FROM TABLE
Where Year = '$(vYear)'

How do I set the variable (vYear) before loading?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I found what I was looking for in Ralfs Becher's TwitView Qlikview:

Here: http://community.qlik.com/media/p/171902.aspx

This file has a Inputbox where you can enter a variabel and when you reload it uses those variables in to get the wanted information from your datasources.

For those who are interested take a look at the document and see what it does.

Follow vScreenname (vSN) in the script.

Let vSN = lower('$(vScreenname)');


View solution in original post

11 Replies
Not applicable
Author

hi,

i think in qlikview dynamic loading is not possible. am not sure..

one thing u do, load whole data and put in hide mode. when the user give the input as 2009 and clik on a button then we can display the corresponding data.

think it once..

Regards

A'run'

Anonymous
Not applicable
Author

Thanks for the reply, nice work around, but that is not going to work for me in this case.
Also I want to use this method to reduce the data, but that is not the mean reason.

Anybody else has an idea?

Not applicable
Author

You can do it two ways - using a variable or with an exists test based on the value in an XLS (for example). You may want to try both to see what offers the best performance.

Creating a variable to test against:

tParam:
LOAD Year
FROM paramfile.xls (biff, embedded labels, table is Sheet1$);

LET vYear = peek('Year', 0, tParam);

DROP TABLE tParam;

Load *
SQL SELECT
FROM TABLE
WHERE Year = $(vYear);

or using exists test

tParam:
LOAD ParamYear
FROM paramfile.xls (biff, embedded labels, table is Sheet1$);

Load *
SQL SELECT
FROM TABLE
WHERE exists(ParamYear, Year);

DROP TABLE tParam;

Regards,

Gordon

Anonymous
Not applicable
Author

Than ks Gordon,

That is an idea, I am going to take a look at this.

Do you think there is a way to make Qlikviewwrite this varaible to a file?

That way I could make first "page" where the user fills the variable(s)
then make an action which writes the paramfile and then perform the load.

Not applicable
Author

....or why not just use an input field with vYear?

I am assuming you are talking about someone reloading the document through QV client because you cannot force a reload through the plugin (at least not directly)...

Anonymous
Not applicable
Author

No the Year input is just an example.
I need this variable before loading because when I load all it ruines my data.
This has to do with different formats in different datasources.
I want to get the right information from the right datasource using this input variable.

Anonymous
Not applicable
Author

I found what I was looking for in Ralfs Becher's TwitView Qlikview:

Here: http://community.qlik.com/media/p/171902.aspx

This file has a Inputbox where you can enter a variabel and when you reload it uses those variables in to get the wanted information from your datasources.

For those who are interested take a look at the document and see what it does.

Follow vScreenname (vSN) in the script.

Let vSN = lower('$(vScreenname)');


Not applicable
Author

Hi everyone,

this might be the solution to what I was looking for. Unfortuntately, the link is not working anymore. Any chance to get the correct link?

Kind regards,

Daniela

Not applicable
Author

Hi. I'm in the same boat as Daniela above. Any chance somebody could post a working link for this? It looks to be exactly what i'm looking for.

Regards, Glyn.