Discussion Board for collaboration on QlikView Scripting.
Sorry if this has been asked before but I am having a problem with the DynamicUpdateCommand,
I am trying to update a field called value to it's value + 1, eventually it will be more complicated than this but I cannot get even this basic operation to work.
My code inside a macro is:
set result1 = ActiveDocument.DynamicUpdateCommand ("UPDATE * SET Value = Value + 1 Where IDVal = 'CC_145'")
this does nothing, however if I remove the Value + parts it does update to 1:
set result1 = ActiveDocument.DynamicUpdateCommand ("UPDATE * SET Value = 1 Where IDVal = 'CC_145'")
The above does work does not achieve what we need.
Any help would be great!
Go to Solution.
Hi. Try with this module :
vChosenId = ActiveDocument.GetVariable("vChosenId").GetContent.String
vChosenIdValue = CInt(ActiveDocument.GetVariable("vChosenIdValue").GetContent.String)
query="UPDATE Data SET value = "&vChosenIdValue+1&" Where id = '"&vChosenId&"'"
if (sqlerror = false) then ' send message when error
And create 2 variables : 1 which store the chosen id and 1 which store the value for the chosen id (easy to create with function Only and a Set Analysis)
Which version of QV are you using? Please can you post the sample document? It will be easy for me to test.
Thanks - DV
Thanks for your reply. I have added my development file to the question.
I am using QV 10 SR3.
Thanks again for any help you can offer,
I wondered if anyone could help with this and I am still confused as to what I am doing wrong?