Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
NickHoff
Specialist
Specialist

Conditional Load based on ServerName

Is it possible to do a conditional load in Qlikview.  For example IF(ServerName = QA) do this load with direct path.  If not do this load with relative paths?  If so, would you post an example?  I can't seem to get relative paths to work if it's not selected and the direct path won't work if relative path is selected.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Generally the solution is like:

LET vDataPath = If(ComputerName() = 'QA', 'D:\QlikView\QVD', '..\QVDs');

LOAD ...

FROM [$(vDataPath)\facts.qvd] (qvd);

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Generally the solution is like:

LET vDataPath = If(ComputerName() = 'QA', 'D:\QlikView\QVD', '..\QVDs');

LOAD ...

FROM [$(vDataPath)\facts.qvd] (qvd);

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

NickHoff
Specialist
Specialist
Author

Thanks Rob!

NickHoff
Specialist
Specialist
Author

Rob to add to this question.  If i'm looking to load from different environments in the same load.  I.E. a reconciliation app, I have to use the direct path.  However it seems using \\servername\qlikview into the correct directory doesn't work.  Is there a specific syntax i'm missing?  here is what i'm currently using:

[?????????.?????.corpadqa.net\E:\QlikView\RBA\1.Common\1.2.QVD\1.2.1.Stage1\file.qvd]


I've tried without the drive letter tried adding \\ before the server, and several others.


Edit:  I've identified the problem and it's adding a prefix to my direct path shown below in red, where is this prefix stored and how do I change it?  


Cannot open file 'Q:\1.Common\1.1.Applications\1.1.1.Stage1\????????.??????.corpadqa.net\E:\QlikView\RBA\1.Common\1.2.QVD\1.2.1.Stage1\1.2.1.Common_PatientFact_ADDate.qvd' The specified path is invalid.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It seems to be interpreting your path as a relative path.  The error msg is showing the computed absolute path.

Using "\\" in the front of you path should be interpreted as an absolute path.  To debug this you need to look at the actual variable substitution in the Document Log for this LOAD statement.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com