Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
warrentk80
Creator
Creator

set variable

Hello everyone, I need to store the value of a variable in a text file to read then later to do the analysis on the basis that the information Employment varibile (set via input box and / or button)

Show me someone would know how to store the value of a variable?

thanks

Andrea

8 Replies
Not applicable

hi

try this

store $(variablename) into D:\test.txt;

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the below link.

     http://community.qlik.com/thread/57133

     http://www.qlikfix.com/2013/09/06/importing-and-exporting-variables/

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
warrentk80
Creator
Creator
Author

good morning

Thank you for your kind and quick response.

where to launch through the store command button $ (variablename) into 😧 \ test.txt? the store is a command script how do I run it from the front end?

thanks

Andrea

senpradip007
Specialist III
Specialist III

try this

store $(VariableName) into <dir_path>\Store.txt

Here Dir_path is the pathname where you want to store the file.

warrentk80
Creator
Creator
Author

good morning

Thank you for your kind and quick response.


but where execute this comand?



Not applicable

try this

in script side write this code.

Let var1=5;

Store $(var1)  into  D:\test.txt;

warrentk80
Creator
Creator
Author

how do I run the script code from the button?

Not applicable

Hi Andrea,

I guess, you want to store the Variable value from the UI/Front end only, as per my knowledge we can not store anything to a file (text/excel etc) from UI. If you are looking for write back capability, then you will have to write a macro which will actually store the variable value to a text file.

Create a list box and use expression to get variable value and use below macro. Keep Requested Module Security as System Access and Current Local Security as Allow System Access. Create a button and trigger this macro.

sub test

set lb = ActiveDocument.GetSheetObject("LB01")

lb.Export "D:\Amey\Training\test.txt" , ";"

end sub

Hope this helps!

Thanks,

Amey