<?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: Update multiple records using marco in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087876#M362056</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From what I experienced earlier when working with Dynamic Update the UPDATE statement was perfectly capable of updating multiple values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the problem should be in how the UPDATE statement is constructed I would think. Unless there is some kind of bug...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Feb 2016 10:04:13 GMT</pubDate>
    <dc:creator>petter</dc:creator>
    <dc:date>2016-02-11T10:04:13Z</dc:date>
    <item>
      <title>Update multiple records using marco</title>
      <link>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087873#M362053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Community,&lt;/P&gt;&lt;P&gt;I have a case in which I need to update existing records based on a filter object.&lt;/P&gt;&lt;P&gt;Basically, the case can be summed up as follows:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Update multiple rows (a certain loop is required)&lt;/LI&gt;&lt;LI&gt;The Update is filter based, only selected values in a filter object should be updated&lt;/LI&gt;&lt;LI&gt;The macro should be able to count the number of selected value in the filter object&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The following pseudo-code represents what I aim for:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For int i=0 to GetSelectedCount(Filter)&lt;/P&gt;&lt;P&gt;Update Field where Field.value = Filter.Value&lt;/P&gt;&lt;P&gt;Next i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is much appreciated,&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Rawad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 09:21:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087873#M362053</guid>
      <dc:creator />
      <dc:date>2016-02-10T09:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Update multiple records using marco</title>
      <link>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087874#M362054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;The short answer: QlikView does not have any easy to use method to do that safely.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The long answer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you state how the use of this functionality should be? &lt;/P&gt;&lt;P&gt;Is it for many users to do ad-hoc? &lt;/P&gt;&lt;P&gt;Is it in QlikView Desktop for single user that can perform his own reload?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;You could get write-back functionality in this way:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Buy off-the-shelf add-on, check market.qlik.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Create you own - which can be a significant effort depending on your requirements&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - web-service write-back&lt;SPAN style="font-size: 13.3333px;"&gt; - with frequent reloads or partial reloads&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - file + database write-back - with frequent reloads or partial reloads&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - use the still existing Dynamic Update functionality, &lt;SPAN style="text-decoration: underline;"&gt;poorly documented and not very robust&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This could look like your proposed method - but multi-user access to in-memory data model&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; will create huge problems. If used in a single user desktop environment it might work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 12:12:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087874#M362054</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2016-02-10T12:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Update multiple records using marco</title>
      <link>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087875#M362055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply Petter.&lt;/P&gt;&lt;P&gt;Let us suppose we are working &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;in a single user desktop environment and consider the following method (which I tried):&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Create a button and add to it a dynamic update event &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Create a filter object and name it TestTest&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The statement in the button is as follows: UPDATE Test SET Discount = '1123' WHERE TestTest='$(=only( [TestTest] ))'&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Obviously, we need to update the record discount in the table Test&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The problem with this method is that only one record can be updated. Suppose multiple values are to be selected, the method fails (no records are updated). Why do you think is that ? Is there any way to fix it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Sincerely,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Rawad &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 08:19:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087875#M362055</guid>
      <dc:creator />
      <dc:date>2016-02-11T08:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Update multiple records using marco</title>
      <link>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087876#M362056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From what I experienced earlier when working with Dynamic Update the UPDATE statement was perfectly capable of updating multiple values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the problem should be in how the UPDATE statement is constructed I would think. Unless there is some kind of bug...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 10:04:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087876#M362056</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2016-02-11T10:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update multiple records using marco</title>
      <link>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087877#M362057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There doesn't seem to be any syntax errors. When only 1 value is selected in the filter object, the update statement works fine. Only when multiple values are selected, does the problem occur.&lt;/P&gt;&lt;P&gt;Any ideas as to why ? Please find attached the application I am doing the testing&amp;nbsp; process with.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Looking forward to any input you may offer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #66696a; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; white-space: pre-line; background-color: #f1f3f5;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 10:48:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087877#M362057</guid>
      <dc:creator />
      <dc:date>2016-02-11T10:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Update multiple records using marco</title>
      <link>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087878#M362058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answering quickly without having had a look at your app I am pretty sure that the problem is due to the WHERE part of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;UPDATE Test &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET Discount = '1123' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;WHERE &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TestTest='$(=only( [TestTest] ))'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;TestTest will test for only one selected value ... which also the Only()-function insist on...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Having several selected values will return Null and thus WHERE will not match any values and nothing will be updated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 11:49:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-multiple-records-using-marco/m-p/1087878#M362058</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2016-02-11T11:49:45Z</dc:date>
    </item>
  </channel>
</rss>

