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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

Load variable from text file

Hi there,

If I have a text file named "vPQLow.txt" that contains only a single value (e.g. "54"), how can I get this value and use the 54 as a variable in my Load script?

What I am doing is working from a Powershell script which allows a user to input a campaign number, and this will then create a file with that number in it - I then need to use this number as a variable in QLikView.

Labels (1)
3 Replies
Not applicable

Hi Gerhard,

Hope the below script helps you.

Variable_Table:

LOAD @1

FROM

Variable_Txt.txt

(txt, codepage is 1252, explicit labels, delimiter is '\t', msq);

LET X=NUM(Peek('@1',0,'Variable_Table'));

gerhardl
Creator II
Creator II
Author

Thanks Ajay,

I actually just figured out another way to do it, which I think works a bith better. In PowerShell i create the text file to not just right "54", but rather to write "LET vPQLow = 54;"

And then I do this in my QV Script:

$(Include=C:\Path\vPQLow.txt);

Not applicable

Thanks Gerhard.

That seems to be much easy way than what i posted

Keep sharing the new findings.

Regards,

Achiever