Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
bmenicucci
Creator
Creator

Identify what environment we are

Hello qlikers,

I've a quick question for you laid on the beach!

I'm using my QDF scripts in both Qlik Sense and Qlik View. The question is: how do I know, from a script perspective, which environment I am dealing with? This can be useful, for instance, during an automated "LOAD" of QVDs: if you are in QS, to identify the path of the file you have to use "/" while in QV you have to use "\".

Any idea?

Thanks a lot and have a nice summer time!

Brunello

1 Reply
bmenicucci
Creator
Creator
Author

This is my actual script: it looks like I'm able to make it work on QS or QV but not both!

LET QVD = '$(vG.LoadPath)';

// Generate the Loop for each value in the LIST_OF_TABLES table

FOR EACH vFileName IN filelist(QVD& '\*.qvd')

IF NOT ISNULL('$(vG.HomeContainer)') THEN

LET vFileBaseName=replace(subfield('$(vFileName)', '/', -1), '.qvd', '');

ELSE

  LET vFileBaseName=replace(subfield('$(vFileName)', '\', -1), '.qvd', '');

ENDIF

[$(vFileBaseName)]:      

LOAD

  *

FROM $(vFileName) (qvd);  

next vFileName