Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ETL inside loadscript - Conditional load based on a variable?

I have 5 huge delimited text files containing data that need transformations.  For development purposes, I want to do the following:

LET vToggleETL = 1;

if vToggleETL = 1 {

     // load text files and develop data model, do any transformation as necessary

     // store tables into QVD's

}

else {

     // LOAD data model from qvd's

}

I'd like to toggle vToggleETL from time to time.  Also, the client has said the input files will remain the same month to month.  So for data refreshes, I'll just toggle vToggleETL.

Questions:  1)  Is this the best approach?  2)  Is this the correct syntax?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

1. Sounds sensible. What you can do is set the variable at the end of the script instead and give it the value 0. You can pass a variable name + value as parameter if you want to reload it: qv.exe /r /vvToggleETL=1 "d:\qvapps\myqvwapp.qvw". The double v is intended. /v for passing a variable followed by the variable name

2. See below:

if $(vToggleETL) = 1  then 

     // load text files and develop data model, do any transformation as necessary 

     // store tables into QVD's 

else

     // LOAD data model from qvd's

end if

LET vToggleETL = 0;


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar

1. Sounds sensible. What you can do is set the variable at the end of the script instead and give it the value 0. You can pass a variable name + value as parameter if you want to reload it: qv.exe /r /vvToggleETL=1 "d:\qvapps\myqvwapp.qvw". The double v is intended. /v for passing a variable followed by the variable name

2. See below:

if $(vToggleETL) = 1  then 

     // load text files and develop data model, do any transformation as necessary 

     // store tables into QVD's 

else

     // LOAD data model from qvd's

end if

LET vToggleETL = 0;


talk is cheap, supply exceeds demand