Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use Dynamic update action in QV 11

Hi,

Can any one tell me how to use the Dynamic update action in QV 11 .. Do We need to write macro to use this?

53 Replies
Not applicable
Author

Hi Martin,

I have no clue if it is possible to combine Dynamic Update and Object Extension, but the QlikCommunity might have a clue. You might want to check this:

Triggering actions from Extensions

You could simulate a button click with an action that triggers a dynamic update or you could change the value of a variable that triggers an action.

Does that bring you on your way?

Kind regards

Matthias

Not applicable
Author

Hi Matthias,

This is in reply to your dynamic update example..

In your example when exporting to xml from tablebox, The xml tag hierarchy is as follows:

1) <Tablebox>

2)<Title of tablebox>

3)<First column name>value</>

4)<Second column name>value</>

and so on..

</Title of tablebox>

</Tablebox>

I need to have attribute and value pairs as well inside the tags

eg.

...

..

<First column name SomeAttribute="Value">value</>

Thanks in Advance.

Not applicable
Author

Hi Pratik,

I just used the standard xml-export functionality. I am not aware if you can change the exporting schema or type. What you could do is creating the XML-file with macro funtionality. But that is propably not the best idea...

What are you trying to achieve?

Best regards

Matthias

Not applicable
Author

Hi Matthias,

I have attached the .qvw file. The xml file which gets generated is something like this...

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<TableBox>

<_empty_>

  <StudyNumber>abc</StudyNumber>

  <Study_x0020_Name>100</Study_x0020_Name>

</_empty_>

</TableBox>

But I want something like this..

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<TableBox>

<_empty_>

  <StudyNumber Someattribute="SomeValue" SomeotherAttribute="SomeOtherValue"></StudyNumber>

<Study_x0020_Name Someattribute1="SomeValue1" SomeotherAttribute2="SomeOtherValue2"></Study_x0020_Name>

  </_empty_>

</TableBox>

Thanx in Advance!

Not applicable
Author


Hi,

Why does it not work in Access Point?

Not applicable
Author

Try it out. Some dynamic update functionalities work also in Access Point.

But for sure all ways which include macros will not work in AJAX b/c it's not supported. You might use Access Point with IE PlugIn. Then it works like the way in the full client.

Not applicable
Author

Thanks for the reply.

But its not working with IE plugin.


Not applicable
Author

Dynamic has to be activated on the server and in the document:

DynamicUpdateServer.png

DynamicUpdateDocument.png

How to use Dynamic update action in QV 11

Anonymous
Not applicable
Author

Hi Matthias,

I am attaching my questions at this point of the thread since you mention something I am exploring.

Briefly: my goal is to populate an initially empty data island table (e.g. [Table2]) with values coming from a different resident table (e.g. [Table1]). Both tables are in the data model at the end of the script's execution, the number of fields between the two tables is the same and the tables also share the same field names, the field names have been qualified to avoid association (e.g. Table1.Field1, Table2.Field1, etc.).

All the Dynamic Update examples I have downloaded use fixed values for the fields being updated and, since I could not find much information regarding the syntax of Dynamic Update, I tried the following:


. INSERT INTO Table2 (Table2.Field1, Table2.Field2) VALUES (Table1.Field1, Table1.Field2)


. INSERT INTO Table2 (Table2.Field1, Table2.Field2) SELECT Table1.Field1, Table1.Field2 FROM Table1

and other variations of the above expressions. None seems to be working.

When you say


"[...] I have used GetFieldSelections in combination with Dynamic Update in the past. It seems to be easier to build up an SQL-Statement in macro (using loops etc.) and fire that"


What SQL statement did you build exactly?

By "using loops, etc." I hope you don't mean it is necessary to insert one single row at a time from source to destination, or is that the case?


Thank you very much for your help

Not applicable
Author

Here is my example for inserting one new row:

sub CreateDUMMY()

  Dim BelegID

    Dim fieldname(11)

    Dim fieldvalue(11)

  BelegID= ActiveDocument.Variables("vDummyBelegID").GetContent.String

  fieldname(0) = "MatchID"

  fieldname(1) = "abzugsfähige Steuer"

  fieldname(2) = "Belegdatum"

  fieldname(3) = "BelegID"

  fieldname(4) = "BelegJahr"

  fieldname(5) = "BelegMonat"

  fieldname(6) = "BelegQuartal"

  fieldname(7) = "BelegTyp"

  fieldname(8) = "BetrifftJahr"

  fieldname(9) = "BetrifftMonat"

  fieldname(10) = "Bruttobetrag"

  fieldname(11) = "Buchungsdatum"

  fieldvalue(0) = ActiveDocument.Variables("vDummyMatchID").GetContent.String

  fieldvalue(1) = ActiveDocument.Variables("vDummyabzugsfähigeSteuer").GetContent.String

  fieldvalue(2) = ActiveDocument.Variables("vDummyBelegdatum").GetContent.String

  fieldvalue(3) = BelegID

  fieldvalue(4) = ActiveDocument.Variables("vDummyBelegJahr").GetContent.String

  fieldvalue(5) = ActiveDocument.Variables("vDummyBelegMonat").GetContent.String

  fieldvalue(6) = ActiveDocument.Variables("vDummyBelegQuartal").GetContent.String

  fieldvalue(7) = ActiveDocument.Variables("vDummyBelegTyp").GetContent.String

  fieldvalue(8) = ActiveDocument.Variables("vDummyBetrifftJahr").GetContent.String

  fieldvalue(9) = ActiveDocument.Variables("vDummyBetrifftMonat").GetContent.String

  fieldvalue(10) = ActiveDocument.Variables("vDummyBruttobetrag").GetContent.String

  fieldvalue(11) = ActiveDocument.Variables("vDummyBuchungsdatum").GetContent.String

    SQL_String=""

  SQL_String=SQL_String & "INSERT INTO * "

  SQL_String=SQL_String & "("

  SQL_String=SQL_String & fieldname(0)

  for i=1 to 11

  SQL_String=SQL_String & ",[" & fieldname(i) & "]"

  next

  SQL_String=SQL_String & ")"

  SQL_String=SQL_String & "VALUES "

  SQL_String=SQL_String & "('"

  SQL_String=SQL_String & fieldvalue(0)

  for i=1 to 11

  SQL_String=SQL_String & "','" & fieldvalue(i)

  next

  SQL_String=SQL_String & "')"

  SET Result = ActiveDocument.DynamicUpdateCommand ( SQL_String )

  if Result = false then

  MsgBox "Error: " & Result.ErrorMessage

  else

  MsgBox "Beleg erstellt. BelegID: " & BelegID

  ActiveDocument.Fields("BelegID").ToggleSelect BelegID

  end if

end sub