<?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 Dynamic update in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149814#M27935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michel,&lt;/P&gt;&lt;P&gt;You are right. It means that CostPrice=CostPrice*Var and Var may be a input or slider.&lt;/P&gt;&lt;P&gt;But my problem is I want to update data in qv file and I can not update column CostPrice in table Product"&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Thai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jul 2009 04:02:58 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-07-21T04:02:58Z</dc:date>
    <item>
      <title>Dynamic update</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149812#M27933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In script, I load products.qvd:&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;Products:&lt;BR /&gt;LOAD ProductID,&lt;BR /&gt; ProductDescription,&lt;BR /&gt; StartDate,&lt;BR /&gt; EndDate,&lt;BR /&gt; CostPrice&lt;BR /&gt;FROM&lt;BR /&gt;..\..\DataSources\Products.qvd&lt;BR /&gt;(qvd);&lt;/B&gt;&lt;BR /&gt;------------------------------------------------&lt;BR /&gt;Now, i want to create a button when click on this button&lt;BR /&gt;the CostPrice will be update with formula&lt;BR /&gt;Ex: CostPrice=CostPrice*1.15&lt;BR /&gt;&lt;BR /&gt;I tried with subroutine:&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;I&gt;sub update&lt;BR /&gt; ActiveDocument.DynamicUpdateCommand("UPDATE Products SET CostPrice=CostPrice*1.15")&lt;BR /&gt;end sub&lt;/I&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;but there are no change&lt;BR /&gt;&lt;BR /&gt;How can i solve this problem?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 02:51:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149812#M27933</guid>
      <dc:creator />
      <dc:date>2009-07-21T02:51:12Z</dc:date>
    </item>
    <item>
      <title>Dynamic update</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149813#M27934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess is what you really need is not a button but a variable (in input box or slider). If the variable name is Var, the expresions in your chart / tables will include&lt;BR /&gt;&lt;STRONG&gt;CostPrice*Var&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 03:45:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149813#M27934</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-07-21T03:45:17Z</dc:date>
    </item>
    <item>
      <title>Dynamic update</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149814#M27935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michel,&lt;/P&gt;&lt;P&gt;You are right. It means that CostPrice=CostPrice*Var and Var may be a input or slider.&lt;/P&gt;&lt;P&gt;But my problem is I want to update data in qv file and I can not update column CostPrice in table Product"&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Thai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 04:02:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149814#M27935</guid>
      <dc:creator />
      <dc:date>2009-07-21T04:02:58Z</dc:date>
    </item>
    <item>
      <title>Dynamic update</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149815#M27936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thai,&lt;/P&gt;&lt;P&gt;I don't know of any way of updating data other than reload. Probably it's not what you need, but you can use varibale (or constant 1.15 if you wish) in the load script:&lt;BR /&gt;&lt;B&gt;Products:&lt;BR /&gt;LOAD&lt;BR /&gt; ProductID&lt;BR /&gt; ..&lt;BR /&gt; CostPrice,&lt;BR /&gt; CostPrice*$(Var) as NewCostPrice,&lt;BR /&gt; ...&lt;BR /&gt; FROM...&lt;BR /&gt;&lt;/B&gt; If you want to keep the same field name:&lt;BR /&gt;&lt;B&gt;DELETE FIELD CostPrice FROM Products;&lt;BR /&gt;JOIN (Products) LOAD&lt;BR /&gt; ProductID,&lt;BR /&gt; NewCostPrice as CostPrice&lt;BR /&gt;RESIDENT Products;&lt;/B&gt;&lt;BR /&gt;So your button should assign value to Var, run reload, and save. Simpe enough, except it make take long time depending on your data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2009 06:09:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149815#M27936</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-07-21T06:09:20Z</dc:date>
    </item>
    <item>
      <title>Dynamic update</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149816#M27937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help that is ok.&lt;/P&gt;&lt;P&gt;In my case, I want only change products which were selected.&lt;/P&gt;&lt;P&gt;My problem is I didn't turn on dynamic update attribute of document&lt;/P&gt;&lt;P&gt;The problem is solved as below:&lt;/P&gt;&lt;P&gt;&lt;B&gt;sub vbCostPriceUpdate&lt;/B&gt;&lt;BR /&gt; dim NoSelected, answer,strValue&lt;BR /&gt;&lt;B&gt;&lt;I&gt;' Get product list which are selected&lt;BR /&gt;&lt;/I&gt;&lt;/B&gt; set possibleValues = ActiveDocument.Fields("ProductID").GetPossibleValues&lt;BR /&gt;&lt;BR /&gt; NoSelected=possibleValues.Count&lt;BR /&gt; if (NoSelected&amp;gt;0) then&lt;BR /&gt;&lt;BR /&gt; &lt;I&gt;&lt;B&gt;' Set DynamicDataUpdate=true for current document&lt;/B&gt;&lt;/I&gt;&lt;BR /&gt; set curDoc = ActiveDocument.GetProperties&lt;BR /&gt; curDoc.EnableDynamicDataUpdate=true ' &lt;I&gt;&lt;B&gt;&amp;lt;---- Here is my problem when I can not UPDATE&lt;/B&gt;&lt;/I&gt;&lt;BR /&gt; ActiveDocument.SetProperties curDoc&lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;' Get new costprice from variable&lt;/B&gt;&lt;BR /&gt; SET objSource = ActiveDocument.Variables("vNewCost")&lt;BR /&gt; strValue = objSource.GetContent.String&lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;' Update each selected row in table Products&lt;/B&gt;&lt;BR /&gt; for i=0 to NoSelected-1&lt;BR /&gt; query="UPDATE Products SET CostPrice="&amp;amp; strValue &amp;amp; " WHERE ProductID='"&amp;amp; possibleValues.item(i).text &amp;amp; "'"&lt;BR /&gt; set sqlerror=ActiveDocument.DynamicUpdateCommand(query)&lt;BR /&gt; if (sqlerror = false) then &lt;B&gt;' send message when error&lt;/B&gt;&lt;BR /&gt; MsgBox sqlerror.ErrorMessage&lt;BR /&gt; exit sub&lt;BR /&gt; end if&lt;BR /&gt; next&lt;BR /&gt; end if&lt;BR /&gt; &lt;B&gt;' save all change in current document&lt;/B&gt;&lt;BR /&gt; ActiveDocument.Save&lt;BR /&gt;&lt;B&gt;end sub&lt;/B&gt;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;I want to say thanks again.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Thai&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2009 00:53:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149816#M27937</guid>
      <dc:creator />
      <dc:date>2009-07-22T00:53:26Z</dc:date>
    </item>
    <item>
      <title>Dynamic update</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149817#M27938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i saw that the WHERE clause is a must.&lt;/P&gt;&lt;P&gt;meaning, you must put the " WHERE CostPrice=CostPrice" in your query, at the end.&lt;/P&gt;&lt;P&gt;it worked for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2009 12:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149817#M27938</guid>
      <dc:creator>mongolu</dc:creator>
      <dc:date>2009-08-03T12:40:07Z</dc:date>
    </item>
    <item>
      <title>Dynamic update</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149818#M27939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thai,&lt;/P&gt;&lt;P&gt;Does your application work on the server. I have a similar application. I am getting a "Macro parse failed. Functionality was lost." when the DynamicUpdateCommand is executed. The application runs fine locally on my computer.&lt;/P&gt;&lt;P&gt;Any ideas what causing this error?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Mar 2010 03:35:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149818#M27939</guid>
      <dc:creator />
      <dc:date>2010-03-24T03:35:20Z</dc:date>
    </item>
    <item>
      <title>Dynamic update</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149819#M27940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;when the application runs on QVServer, with Ajax, plug-in or other client, I know that there is a special Server licence to install...&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 11:32:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-update/m-p/149819#M27940</guid>
      <dc:creator>partenope</dc:creator>
      <dc:date>2010-06-30T11:32:43Z</dc:date>
    </item>
  </channel>
</rss>

