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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load script from external txt-file

I want to put my script in a txt-file instead of storing it in the qvs-file so I can version handle it. I put the code

$(include = "subfolder/filename.txt");

in my qvs-file but when I reload no data gets loaded. What am I doing wrong?

3 Replies
Not applicable
Author

Hi,

There should not be double quotes.

Your script should look like this


$(include = subfolder/filename.txt);


-Peterson

Not applicable
Author

I tried this also. It doesn't work.

Can I put the whole script in the txt-file or does some part of it need to be in the qvs-file? Now my qvs-file only contains the include-code.

Not applicable
Author

Hi,

Check this application.

i have only include statement in my script and i have all my codes in text file.

It works as expected for me.

Below is the script which i have in text file


Test:
Load Product,
subfield(Sales,',') as Sales_New,
Sales;
LOAD * INLINE [
Product, Sales
a, "235,235,235"
b, "235,236,237"
c, "222,222,222"
d, "222,223,224"
];
Test1:
Load Product,
if(Peek(Product) = Product and peek(Sales_New) = Sales_New, Sales_New,Sales) as Sales_New1,
Len(if(Peek(Product) = Product and peek(Sales_New) = Sales_New, Sales_New,Sales)) as Length,
Sales,
Sales_New
Resident Test;
Drop Table Test;
Right Join(Test1)
Load Product,
Min(Length) as Length
Resident Test1 group by Product;

-Peterson