Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

karthick01
New Contributor III

What is the use of Script Parameters in QMC?

Hi,

What is the use of Script Parameters in QMC?

If I select a field (Say Financial year and it has 3 values 2001,2002 and 2003) by using the option "open document". Does the server create 3 new source document at the time of reload?

When can we use Parameter name and value. Any use case?

Please do not copy paste the description from the manual. I did not understand from that.

Thanks,

Karthick

2 Replies
Highlighted
Partner
Partner

Re: What is the use of Script Parameters in QMC?

let's say that you have a qvw to be reloaded and need to create several copies of the same document with different set of data.  For example you need to have one document with data between date1 and date 2  and other with the data between data 3 and data 4...etc

So you have to define a variable that allows you to loop between the  data ranges. For example:

for p=3 to 6

let ini=$(p);

let fin=$(ini)+5;

let vMinDate= Num(Monthstart(addmonths(today(1),-$(fin))));

let vMaxDate= Num (floor((MonthEnd(addmonths(today(1),-$(ini))))));

let vMinDateString=date($(vMinDate),'YYYYMM');

let vMaxDateString=date($(vMaxDate),'YYYYMM');

data:

LOAD *

FROM

your path (qvd);

then in the QMC you put in the parameter name the name of the variable p

an in the parameter value you put 3-6 or 3;4;5;6.

Make sure you create a way to differentiate the name of the distributed documents

for example %SourceDocumentName% _ %DocumentField,Min% _ %DocumentField,max%, if you do not do this you will overwrite the same document

I Hope this help

karthick01
New Contributor III

Re: What is the use of Script Parameters in QMC?

Thanks Hector Garcia. This is very useful.