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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating and executing dynamic text-file on button click

Hello community,

I navigate through a document using one ID at a time. This code will give me the according ID:

=only({<Order={'=rank(-Order)=$(vRank)'}>} ID)

I need to create a text-file that has a mainly static structure passing the current ID to the text. Actually this text file has a extension that once clicked, opens up a program with the given search text.

Now ideally the text-file wouldn't need to actually be saved but only created (and removed) when the button was clicked.

Example of how the text might look:

search

doc_type=ABC

ID=007

Here only the number behind ID= needs to be dynamic.

So this code gives me above text:

='search' & Chr(10) & 'doc_type=ABC' & Chr(10)

&'ID='& only({<Order={'=rank(-Order)=$(vRank)'}>} ID)

But how could I create the file and use it as a variable?

I'm guessing macros are the only way here.

Manually I can get it to work when using the Launch Action and simply paste a valid filepath to the filename property.

Thank you,

Thorsten

5 Replies
sujeetsingh
Master III
Master III

just go for macro and call an action to run Macro

Not applicable
Author

I should add that till now I was able to avoid macro coding hence I don't know how to start

Oh, and I need it to work in the browser.

A small sample would help.

Thank you.

Not applicable
Author

still looking for a solution here. Anybody?

Not applicable
Author

Hi Thorsten,

how do you pass the created text on?

Could you just create two variables - one with the basic text including a second which contains your code giving the ID:

search

doc_type=ABC

ID=$(varID)

?

Afterwards you pass the first variable on.


Best regards,

Chris

Not applicable
Author

Chris that's what I had in mind - my problem is more the second part: somehow creating the file and then trigger the external program.

Maybe it's possible to write the first variable to a file on disk and execute that path so that the content of the file changes when variable2 also changes. But VB isn't my friend