Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Pass parameters when loading script for QVW

Hi

Is it possible that parameters can be passed into a QVW when it is being reloaded.  What I am looking to do is have the ability to load data for a given period, say 1st April 2014 to 31st July 2014.  Come say mid September, i want to load up to Aug 14.  The idea behind this is that I may want to reload data in Aug, but I dont want the period to change. 

16 Replies
Not applicable

Re: Pass parameters when loading script for QVW

Test1.png

Hi there,

Any number of parameters can be passed into the QVW right before the reload by using the above option. You can create two variables vStart and vEnd in your script and using the above you can pass values to those variables.

Thanks

Not applicable

Re: Pass parameters when loading script for QVW

In my reload I dont have that option.  Must be version?  Im on QV11

Not applicable

Re: Pass parameters when loading script for QVW

Mine is QV11 as well. Can you share your screenshot?

martynlloyd
Contributor III

Re: Pass parameters when loading script for QVW

Hi, I use a qvs file and the INCLUDE statement.

I can even write parameters into the qvs file using another script

Example

Parms:

LOAD

'Set vMyParm = Setting1' as Param1

Autogenerate;

Store Parms into Config.qvs (txt);

regards

M.

Not applicable

Re: Pass parameters when loading script for QVW

can you send me an example. 

I want to be able to pass params into the following where statement where the two dates are on a reload:

DIMFinancialPeriod:

SELECT date as FinancialPeriod

--date as SLRFinancialPeriod

, [Year] as 'Year'

, [quarter] as 'Quarter'

, left([month],3) as 'Month'

,left([month],3) + ' ' +[Year] as 'MonthYear'

,[Year] + ' ' + left([month],3) as 'YearMonth'

FROM Dates;

where date between '2013-04-01' and '2013-04-09';

Not applicable

Re: Pass parameters when loading script for QVW

Hi,

If you are using Desktop version, you can also pass parameters through command line like this

"D:\CLICKVIEW\QlikView\Qv.exe" /l /v var1= %DBNAME D:\qlickview\Copy of rpt_datafile1.qvw


Please refer this link below

Command line arguments in qlickview


Regs

-Ram

Not applicable

Re: Pass parameters when loading script for QVW

thanks but do you have an example based on what i sent

martynlloyd
Contributor III

Re: Pass parameters when loading script for QVW

Create a qvs file with params: you can use notepad or create a blank script and export.

Set vStartDate='2013-04-01';
Set vEnddate='2013-04-09'

Then use include to use it in your script

// Script
$(Include=community.qvs);


...
Where date between $(vStartDate) and $(vEndDate);

regards,

M

Not applicable

Re: Pass parameters when loading script for QVW

Hi

Can you give me an example of this please.

Community Browser