<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: DynamicUpdateCommand fails with multiple tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/DynamicUpdateCommand-fails-with-multiple-tables/m-p/352683#M493117</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont think the link is a problem, but I suspect the dynamic update does not work when the fields are key fields. That's why I suggest that you make aliases for these fields and apply the dynamic update using the aliases. You could possibly collapse everything into one table, but how well that works depends on your data structure. Creating the aliases does not affect your model structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create the aliases, modify your load script, something like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ORDINE:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMORD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMORD As duNUMORD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RIGORD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RIGORD As duRIGORD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIPDOC,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIPDOC As duTIPDOC,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMCAR,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMCAR As duNUMCAR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;FROM ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then modify the dynamic update to use the fields with the du.... prefix&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.... WHERE duTIPDOC = 'o' .... etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2012 08:25:32 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2012-06-14T08:25:32Z</dc:date>
    <item>
      <title>DynamicUpdateCommand fails with multiple tables</title>
      <link>https://community.qlik.com/t5/QlikView/DynamicUpdateCommand-fails-with-multiple-tables/m-p/352680#M493114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I was using DynamicUpdateCommand this way:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13396600759081097" jivemacro_uid="_13396600759081097"&gt;&lt;P&gt;dim stmt&lt;/P&gt;&lt;P&gt;stmt = "UPDATE * SET CHOOSE = 'S' WHERE TIPDOC='o' and NUMORD=123456 and NUMCAR='987654'&lt;/P&gt;&lt;P&gt;set result = ActiveDocument.DynamicUpdateCommand(stmt)&lt;/P&gt;&lt;P&gt; if result = false then&lt;/P&gt;&lt;P&gt;&amp;nbsp; MsgBox "Error with DynamicUpdateCommand. " &amp;amp; result.ErrorMessage&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;It always worked when I had only one table (ORDINE), with some lookup tables.&lt;/P&gt;&lt;P&gt;But when I added more tables it started to fail (result is false and unfortunately result.ErrorMessage is empty, so no clue is given).&lt;/P&gt;&lt;P&gt;I attach my Table Viewer, with some explanation.&lt;/P&gt;&lt;P&gt;I someone can help me, I would appreciate so much, because I can found very few docs about DynamicUpdateCommand in the net.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 07:58:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/DynamicUpdateCommand-fails-with-multiple-tables/m-p/352680#M493114</guid>
      <dc:creator>bluishjoe</dc:creator>
      <dc:date>2012-06-14T07:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: DynamicUpdateCommand fails with multiple tables</title>
      <link>https://community.qlik.com/t5/QlikView/DynamicUpdateCommand-fails-with-multiple-tables/m-p/352681#M493115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect that the problem is related to the fact that TIPDOC, NUMCAR, NUMORD etc are now key fields (actually part of the Syn Key).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest that you make aliases for those fields that exist only in table ORDINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 08:05:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/DynamicUpdateCommand-fails-with-multiple-tables/m-p/352681#M493115</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-06-14T08:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: DynamicUpdateCommand fails with multiple tables</title>
      <link>https://community.qlik.com/t5/QlikView/DynamicUpdateCommand-fails-with-multiple-tables/m-p/352682#M493116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is that I need ORDINE, ORDINE_FO, VARIABILI to be linked together, because I need to filter on ORDINE based on selections on the other tables.&lt;/P&gt;&lt;P&gt;Maybe should I build a single table (ORDINE) with everything inside, using SQL joins?&lt;/P&gt;&lt;P&gt;Otherwise DynamicUpdateCommand will not work?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 08:14:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/DynamicUpdateCommand-fails-with-multiple-tables/m-p/352682#M493116</guid>
      <dc:creator>bluishjoe</dc:creator>
      <dc:date>2012-06-14T08:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: DynamicUpdateCommand fails with multiple tables</title>
      <link>https://community.qlik.com/t5/QlikView/DynamicUpdateCommand-fails-with-multiple-tables/m-p/352683#M493117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont think the link is a problem, but I suspect the dynamic update does not work when the fields are key fields. That's why I suggest that you make aliases for these fields and apply the dynamic update using the aliases. You could possibly collapse everything into one table, but how well that works depends on your data structure. Creating the aliases does not affect your model structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create the aliases, modify your load script, something like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ORDINE:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMORD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMORD As duNUMORD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RIGORD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RIGORD As duRIGORD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIPDOC,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIPDOC As duTIPDOC,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMCAR,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMCAR As duNUMCAR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;FROM ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then modify the dynamic update to use the fields with the du.... prefix&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.... WHERE duTIPDOC = 'o' .... etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 08:25:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/DynamicUpdateCommand-fails-with-multiple-tables/m-p/352683#M493117</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-06-14T08:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: DynamicUpdateCommand fails with multiple tables</title>
      <link>https://community.qlik.com/t5/QlikView/DynamicUpdateCommand-fails-with-multiple-tables/m-p/352684#M493118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're great!! Now it works, thank you so much.&lt;/P&gt;&lt;P&gt;Only a note: in the script fields are case-insensitive, but in DynamicUpdateCommand they are case-sensitive and they refer to the fieldnames loaded in-memory by QlikView, which become all upper-case (you can see it for instance in Table Viewer). So &lt;STRONG&gt;in DynamicUpdateCommand always use upper-case fields names&lt;/STRONG&gt;, otherwise it will throw an error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 09:37:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/DynamicUpdateCommand-fails-with-multiple-tables/m-p/352684#M493118</guid>
      <dc:creator>bluishjoe</dc:creator>
      <dc:date>2012-06-14T09:37:07Z</dc:date>
    </item>
  </channel>
</rss>

