Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ashis
Creator III
Creator III

How to pass variable value in QVW from command line

Hi

I am trying to pass variable value from desktop command line .

 

In my qvw I have following script:

Let vyear=2019;

LOAD
'Customer'&
Ceil(RAND()*100) as CustomerName,
Date(makedate('$(vyear)')+floor(RAND()*(1*365+1))) as Date,
round(RAND()*1000+50,10) as InvoiceValue,
recno() as InvoiceNo
autogenerate 100;

vyear - is the variable I want to pass its value from command line . Now in command line I am writing this command

"C:\Program Files\QlikView\qv.exe" /vvyear=2020 "c:\temp\myqv.qvw"

I want to pass the vyear variable value from command line. It seems it is not working .

Any thoughts.

Thank you.

 

1 Solution

Accepted Solutions
Taoufiq_Zarra

Maye be :

//Let vyear=2019;

LOAD
'Customer'&Ceil(RAND()*100) as CustomerName,
Date(makedate('$(vyear)')+floor(RAND()*(1*365+1))) as Date,
round(RAND()*1000+50,10) as InvoiceValue,
recno() as InvoiceNo
autogenerate 100; 

 

and

"C:\Program Files\QlikView\qv.exe" /r /vvyear=2020 "c:\temp\myqv.qvw"

 

and reopen the document

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

5 Replies
Taoufiq_Zarra

Maye be :

//Let vyear=2019;

LOAD
'Customer'&Ceil(RAND()*100) as CustomerName,
Date(makedate('$(vyear)')+floor(RAND()*(1*365+1))) as Date,
round(RAND()*1000+50,10) as InvoiceValue,
recno() as InvoiceNo
autogenerate 100; 

 

and

"C:\Program Files\QlikView\qv.exe" /r /vvyear=2020 "c:\temp\myqv.qvw"

 

and reopen the document

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
ashis
Creator III
Creator III
Author

Spoiler
 

Hi Taoufiq_ZARRA,

Thank you for your quick reply. It did not work.

I believe we should have the variable in the load script .

 

Taoufiq_Zarra

Works for me.
yes we have to declare the variable
Do you close and open the file ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
ashis
Creator III
Creator III
Author

Hi ,

You are right it works .

Don't we need to define variable in the load script. Do we need to comment the variable in load script ?

Taoufiq_Zarra

yes i think for the first time but after no need

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉