Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to make my script by just change SET vDevelopment = 0; So that i dont need to comment the Path .

Hi All,

I have below script working fine. i need to comment on section A or B , each time. It there a way i can just change the number from 0 to 1 at SET vDevelopment = 0; ? I have long list of vFile .


SET vDevelopment = 0;

IF $(vDevelopment) = 0 THEN

// SECTION A - SERVER
SET vRAWPath = 'C:\Users\actnn\Dropbox\mainqv\QV_RAW\'; //server folder
SET vINPUTPath = 'C:\Users\actnn\Dropbox\mainqv\QV_INPUT_\'; //server folder
SET vQVDPath = 'C:\Users\QV\Dropbox\QV_QVD\'; //server folder

// SECTION B - Paul Note Book

// SET vRAWPath = 'C:\Users\pauly\Dropbox\mainqv\QV_RAW\'; //local folder
// SET vINPUTPath = 'C:\Users\pauly\Dropbox\mainqv\QV_INPUT_\'; //local folder
// SET vQVDPath = 'C:\Users\QV\Dropbox\QV_QVD\'; //server folder


SET vFile200 = 'SO_PMC.CSV';
SET vFile201 = 'GL_PMC.CSV';
SET vFile202 = 'AR_PMC.CSV';
SET vFile203 = 'INVC_PMC.CSV';

else

SET vRAWPath = 'C:\Users\Eksa\Dropbox\QV_RAW\'; //local folder

END IF

 

Paul

1 Solution

Accepted Solutions
atoz1158
Creator II
Creator II

Hi

 

Sorry the $(vComputerID) should be quoted

Try

LET vComputerID = Upper(ComputerName());

//Default Path Settings

SET vRAWPath = '\\SPOCK\D$\DATADUMP\QVRAW\';
SET vQVDPath = '\\SPOCK\D$\QLIKVIEW\QVDs\';

//SECTION A - MY NOTE BOOK
IF '$(vComputerID)' = 'DESKTOP-9837GT0' THEN

SET vRAWPath = 'C:\Users\Pauly\Dropbox\5 QV_Final\QV_RAW\'; //local folder
SET vINPUTPath = 'C:\Users\Pauly\Dropbox\5 QV_Final\QV_INPUT\'; //local folder

SET vFile200 = 'SO_PMC.CSV';

ENDIF

View solution in original post

8 Replies
atoz1158
Creator II
Creator II

Hi

When I have had to set different paths based on the machine it is running from I have used the following style of code in the script.

LET vComputerID = Upper(ComputerName());

//Default Path Settings
SET vRAWPath = '\\SPOCK\D$\DATADUMP\QVRAW\';
SET vQVDPath = '\\SPOCK\D$\QLIKVIEW\QVDs\';

IF $(vComputerID) = 'SPOCK' THEN
//SECTION A - SERVER
SET vRAWPath = 'D:\DATADUMP\QVRAW\';
SET vQVDPath = 'D:\QLIKVIEW\QVDs\';
ENDIF

IF $(vComputerID) = 'MYLAPTOP' THEN
//SECTION B - My Laptop
SET vRAWPath = 'X:\DATADUMP\QVRAW\';
SET vQVDPath = 'X:\QLIKVIEW\QVDs\';
ENDIF

HTH

Regards

Adrian

paulyeo11
Master
Master
Author

Hi Sir

Thank you very much for your sharing.
May I know how do I find out my vComputerID ?

Paul
atoz1158
Creator II
Creator II

Hi

Just put the following into a text box in a simple qvw and if you open this on each of the machines you need to identify that will give you all the computer names. 

=ComputerName()

I tend to uppercase things just to be on the safe side so use

=Upper(ComputerName())

Regards

Adrian

paulyeo11
Master
Master
Author

Hi Sir

I run the below script :-

LET vComputerID = Upper(ComputerName());

//Default Path Settings

SET vRAWPath = '\\SPOCK\D$\DATADUMP\QVRAW\';
SET vQVDPath = '\\SPOCK\D$\QLIKVIEW\QVDs\';

//SECTION A - MY NOTE BOOK
IF $(vComputerID) = 'DESKTOP-9837GT0' THEN

SET vRAWPath = 'C:\Users\Pauly\Dropbox\5 QV_Final\QV_RAW\'; //local folder
SET vINPUTPath = 'C:\Users\Pauly\Dropbox\5 QV_Final\QV_INPUT\'; //local folder

SET vFile200 = 'SO_PMC.CSV';

ENDIF

I get error msg below :-

Script line error:
IF DESKTOP-9837GT0 = 'DESKTOP-9837GT0' THEN

Where i go wrong ?

Paul
atoz1158
Creator II
Creator II

Hi

 

Sorry the $(vComputerID) should be quoted

Try

LET vComputerID = Upper(ComputerName());

//Default Path Settings

SET vRAWPath = '\\SPOCK\D$\DATADUMP\QVRAW\';
SET vQVDPath = '\\SPOCK\D$\QLIKVIEW\QVDs\';

//SECTION A - MY NOTE BOOK
IF '$(vComputerID)' = 'DESKTOP-9837GT0' THEN

SET vRAWPath = 'C:\Users\Pauly\Dropbox\5 QV_Final\QV_RAW\'; //local folder
SET vINPUTPath = 'C:\Users\Pauly\Dropbox\5 QV_Final\QV_INPUT\'; //local folder

SET vFile200 = 'SO_PMC.CSV';

ENDIF

paulyeo11
Master
Master
Author

Hi Sir

Thank you it work fine now.Since you able to make my life more easy , i like to ask you one more follow up question.

My below script Red Color , i have 100 diff raw data file file. i need to have 2 set. may i know how to have just one set ? So easy to maintence.


//Default Path Settings
LET vComputerID = Upper(ComputerName());

SET vRAWPath = '\\SPOCK\D$\DATADUMP\QVRAW\';
SET vQVDPath = '\\SPOCK\D$\QLIKVIEW\QVDs\';

SET vFile200 = 'SO_PMC.CSV';

//SECTION A - MY NOTE BOOK
IF '$(vComputerID)' = 'DESKTOP-9837GT0' THEN

SET vRAWPath = 'C:\Users\Pauly\Dropbox\5 QV_Final\QV_RAW\'; //local folder
SET vINPUTPath = 'C:\Users\Pauly\Dropbox\5 QV_Final\QV_INPUT\'; //local folder

SET vFile200 = 'SO_PMC.CSV';

ENDIF

 

Paul

atoz1158
Creator II
Creator II

Hi

 

If the file names are the same and not dependent on which machine they are on then you only need the one list.

Otherwise can I suggest you look at the Qlikview Cookbook website to see if any of the various tools and examples could help you.

Website is

https://qlikviewcookbook.com/recipes/#squelch-taas-accordion-shortcode-content-11

Regards

Adrian 

paulyeo11
Master
Master
Author

Hi Sir

I have related issue on above mentioned. May be you can advise i get error it is because Bin load unable to apply here ?

https://community.qlik.com/t5/QlikView-Scripting/Bin-Load-getting-error-msg-it-is-due-to-infornt-of-...

 

Paul