<?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 What is the problem in my VBScript? (Dynamic Update) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/What-is-the-problem-in-my-VBScript-Dynamic-Update/m-p/164280#M37039</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;You should set the FunctionTypeScale.low value outside of the SQL by itself. Then you would be able to change your sql and remove that if sentence in it.&lt;/P&gt;&lt;P&gt;if (FunctionTypeScale.Low &amp;gt; 3 then&lt;/P&gt;&lt;P&gt;FunctionVar = 3&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;FunctionVar = FunctionTypeScale.Low&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;Your SQL should look like .&lt;/P&gt;&lt;P&gt;Update FunctionTypeScale set FunctionTypeScale.Low$ = FunctionVar Where Func.....&lt;/P&gt;&lt;P&gt;And that should work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Aug 2009 00:05:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-08-25T00:05:29Z</dc:date>
    <item>
      <title>What is the problem in my VBScript? (Dynamic Update)</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-problem-in-my-VBScript-Dynamic-Update/m-p/164277#M37036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;I load a table as below&lt;/P&gt;&lt;P&gt;&lt;IMG border="0" src="https://community.qlik.com/resized-image.ashx/__size/245x225/__key/CommunityServer.Discussions.Components.Files/11/0882.FunctionTypeScale.bmp" /&gt;&lt;/P&gt;&lt;P&gt;I declared a variable vLowSkill for input value.&lt;/P&gt;&lt;P&gt;And i also wrote a script for update FunctionTypeScale.Low$ column.&lt;/P&gt;&lt;P&gt;The Script will update the selected key with rule:&lt;/P&gt;&lt;P&gt;FunctionTypeScale.Low$=strValue when FunctionTypeScale.Low&amp;gt;strValue&lt;/P&gt;&lt;P&gt;otherwise FunctionTypeScale.Low$=FunctionTypeScale.Low&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;sub vbLowSkillUpdate&lt;BR /&gt; dim nbrSelected, strValue, query, sqlerror,condition, newValue&lt;BR /&gt; ' Get selected Value&lt;BR /&gt; set possibleValues = ActiveDocument.Fields("FunctionTypeScaleKey").GetPossibleValues&lt;BR /&gt;&lt;BR /&gt; ' Get new value&lt;BR /&gt; SET objSource = ActiveDocument.Variables("vLowSkill")&lt;BR /&gt; strValue = objSource.GetContent.String&lt;BR /&gt;&lt;BR /&gt; set docprop = ActiveDocument.GetProperties&lt;BR /&gt; docprop.EnableDynamicDataUpdate=true&lt;BR /&gt; ActiveDocument.SetProperties docprop&lt;BR /&gt;&lt;BR /&gt; nbrSelected=possibleValues.Count&lt;BR /&gt; if (nbrSelected&amp;gt;0) then&lt;BR /&gt; for i=0 to nbrSelected-1&lt;BR /&gt; condition="([FunctionTypeScaleKey]='"&amp;amp; possibleValues.item(i).text &amp;amp; "')"&lt;BR /&gt; newValue=" if([FunctionTypeScale.Low]&amp;gt;"&amp;amp;strValue&amp;amp;","&amp;amp;strValue&amp;amp;",[FunctionTypeScale.Low]) "&lt;BR /&gt; query="UPDATE FunctionTypeScale SET [FunctionTypeScale.Low$]="&amp;amp; newValue &amp;amp; " WHERE "&amp;amp; condition&lt;BR /&gt; set sqlerror=ActiveDocument.DynamicUpdateCommand(query)&lt;BR /&gt; if (sqlerror = false) then&lt;BR /&gt; msgbox(query&amp;amp;chr(10)&amp;amp;"Update has error!")&lt;BR /&gt; exit sub&lt;BR /&gt; end if&lt;BR /&gt; next&lt;BR /&gt; end if&lt;BR /&gt;end sub&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Everything seems to be OK but nothing is updated. Script always display error message.&lt;/P&gt;&lt;P&gt;I don't know why?&lt;/P&gt;&lt;P&gt;Who can help me to solve it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Aug 2009 06:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-problem-in-my-VBScript-Dynamic-Update/m-p/164277#M37036</guid>
      <dc:creator />
      <dc:date>2009-08-23T06:57:23Z</dc:date>
    </item>
    <item>
      <title>What is the problem in my VBScript? (Dynamic Update)</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-problem-in-my-VBScript-Dynamic-Update/m-p/164278#M37037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;what kind of error do you have ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 20:15:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-problem-in-my-VBScript-Dynamic-Update/m-p/164278#M37037</guid>
      <dc:creator />
      <dc:date>2009-08-24T20:15:21Z</dc:date>
    </item>
    <item>
      <title>What is the problem in my VBScript? (Dynamic Update)</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-problem-in-my-VBScript-Dynamic-Update/m-p/164279#M37038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Philippe,&lt;/P&gt;&lt;P&gt;Thanks for your attention.&lt;/P&gt;&lt;P&gt;When the script is run, it display the error as below:&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/4201.Error.bmp"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/4201.Error.bmp" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This message is generated by program. It means that no thing is updated.&lt;/P&gt;&lt;P&gt;TMTHAI&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2009 22:35:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-problem-in-my-VBScript-Dynamic-Update/m-p/164279#M37038</guid>
      <dc:creator />
      <dc:date>2009-08-24T22:35:11Z</dc:date>
    </item>
    <item>
      <title>What is the problem in my VBScript? (Dynamic Update)</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-the-problem-in-my-VBScript-Dynamic-Update/m-p/164280#M37039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;You should set the FunctionTypeScale.low value outside of the SQL by itself. Then you would be able to change your sql and remove that if sentence in it.&lt;/P&gt;&lt;P&gt;if (FunctionTypeScale.Low &amp;gt; 3 then&lt;/P&gt;&lt;P&gt;FunctionVar = 3&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;FunctionVar = FunctionTypeScale.Low&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;Your SQL should look like .&lt;/P&gt;&lt;P&gt;Update FunctionTypeScale set FunctionTypeScale.Low$ = FunctionVar Where Func.....&lt;/P&gt;&lt;P&gt;And that should work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2009 00:05:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-the-problem-in-my-VBScript-Dynamic-Update/m-p/164280#M37039</guid>
      <dc:creator />
      <dc:date>2009-08-25T00:05:29Z</dc:date>
    </item>
  </channel>
</rss>

