Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
canoebi99
Partner - Creator
Partner - Creator

Is it possible to write a variable value back to a record in a table?

Hi all,

I don't think this is possible but thought I would ask the question in case there are any QV wizards out there who might suggest a way to do this!

I have a variable which holds a number value. When the user selects a particular record (i.e. applies a filter down to 1 record only) and then changes this variable I would like to have a button that then writes whatever the value in the variable is back into a field against that record. Essentially updating the data table from the front end of QV.

Is this there a way this could be acheived?

Many thanks

Ben

12 Replies
rustyfishbones
Master II
Master II

Hi Ben,

Do you mean update the Data in the Source database, or updating the Data Table in memory?

Regards

Alan

canoebi99
Partner - Creator
Partner - Creator
Author

Hi Alan,

I don't really need to write it back into the database I am reading from. I just need to store it somewhere (and re read it at load time) so probably into a data table in memory that I could then write out a qvd from as the template closes. Or even write a qvd for each value I want to save if that is easier because I could then read them all back in on the load.

Cheers

Ben

Not applicable

Example for you.

regards

Darek

canoebi99
Partner - Creator
Partner - Creator
Author

Thanks Darek,

This is not quite what I am after, I know how to set the variable. What I want is when I select a record (so in your example say ID 1) and set the variable lets say to 49. I need a button that then stores into a qvd file the ID (1) and Variable Value (49).

If I can do that I can then re read all the stored QVD files back in at load time essentially assigning the value of 49 to the record with an ID of 1 (and any others I have stored).

Cheers

Ben

Not applicable

In my example after setting some variable value, start reload.

About your detailed requirements look for information in the subject of "Dynamic Update"

regards

Darek

canoebi99
Partner - Creator
Partner - Creator
Author

Thanks Darek,

I see now you are reloading a number of records based on the variable value. I am actually trying to assign the variable value to a single record and store this somewhere so that I can reload the value against that record at a later date.

I appreciate you trying to help me.

Regards

Ben

Not applicable

With dynamic update...

Set some new walue on slider and then press xxx button.

You must turn on "Enable Dynamic Data Update" on Document properties/Server

Not applicable

And next demo.

Store button should create qvd on your d: drive.

Press Ctrl+M to edit module.

regards

Darek

canoebi99
Partner - Creator
Partner - Creator
Author

Many thanks Darek,

I had actually just arrived at this myself and thought I had cracked it. The only issue I now have is that the button to run the macro doesn't seem to work on the server version (it works fine on the desktop version).

I will explore the dynamic update option further as I have never used this.

Do you think there would be any solution to then storing the data out to a qvd file seeing as though I can't run that macro to export the data on the server?

Really appreciate your time!

Cheers

Ben