<?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 How to script if-else condition in dynamic update action in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-script-if-else-condition-in-dynamic-update-action/m-p/1206358#M625718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello QlikView community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing the problem to script a (simple) if-else condition in Qlikview.&lt;/P&gt;&lt;P&gt;I want to pull a trigger when changing the value of a variable (variable event trigger , to be specific the "OnInput" option).&lt;/P&gt;&lt;P&gt;When adding the dynamic update action, I want to change a fieldvalue with the string I just entered into the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code looks like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14781648901796815 jive_text_macro" jivemacro_uid="_14781648901796815"&gt;
&lt;P&gt;if&amp;nbsp; '$(vCostCentre)' = '' then&lt;/P&gt;
&lt;P&gt;&amp;nbsp; UPDATE ProfitCenterMap&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SET ProfitCenterMap.CarveOutCategory ='$(vClassification)'&lt;/P&gt;
&lt;P&gt;&amp;nbsp; WHERE LineItem.ProfitCentre = '$(vProfitCentre)' ;&lt;/P&gt;
&lt;P&gt;else&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; UPDATE CostCenterMap&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SET CostCenterMap.CarveOutCategory = '$(vClassification)'&lt;/P&gt;
&lt;P&gt;&amp;nbsp; WHERE LineItem.CostCentre = '$(vCostCentre)' ; &lt;/P&gt;
&lt;P&gt;end if&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;----------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I read the qlikview reference Manual and wrote the script above according to: &lt;A href="https://help.qlik.com/de-DE/qlikview/12.0/Subsystems/Client/Content/Scripting/ScriptControlStatements/If.htm" title="https://help.qlik.com/de-DE/qlikview/12.0/Subsystems/Client/Content/Scripting/ScriptControlStatements/If.htm"&gt;https://help.qlik.com/de-DE/qlikview/12.0/Subsystems/Client/Content/Scripting/ScriptControlStatements/If.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also found another Syntax here &lt;A href="https://community.qlik.com/thread/62297"&gt;IF &amp;amp;amp; Else condition&lt;/A&gt; :&lt;/P&gt;&lt;P&gt;Simple if function:&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor404"&gt;&lt;/A&gt;&lt;A name="if"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;if(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;condition , then , else&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Bold"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Bold"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tuan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Nov 2016 09:23:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-11-03T09:23:44Z</dc:date>
    <item>
      <title>How to script if-else condition in dynamic update action</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-script-if-else-condition-in-dynamic-update-action/m-p/1206358#M625718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello QlikView community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing the problem to script a (simple) if-else condition in Qlikview.&lt;/P&gt;&lt;P&gt;I want to pull a trigger when changing the value of a variable (variable event trigger , to be specific the "OnInput" option).&lt;/P&gt;&lt;P&gt;When adding the dynamic update action, I want to change a fieldvalue with the string I just entered into the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code looks like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14781648901796815 jive_text_macro" jivemacro_uid="_14781648901796815"&gt;
&lt;P&gt;if&amp;nbsp; '$(vCostCentre)' = '' then&lt;/P&gt;
&lt;P&gt;&amp;nbsp; UPDATE ProfitCenterMap&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SET ProfitCenterMap.CarveOutCategory ='$(vClassification)'&lt;/P&gt;
&lt;P&gt;&amp;nbsp; WHERE LineItem.ProfitCentre = '$(vProfitCentre)' ;&lt;/P&gt;
&lt;P&gt;else&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; UPDATE CostCenterMap&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SET CostCenterMap.CarveOutCategory = '$(vClassification)'&lt;/P&gt;
&lt;P&gt;&amp;nbsp; WHERE LineItem.CostCentre = '$(vCostCentre)' ; &lt;/P&gt;
&lt;P&gt;end if&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;----------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I read the qlikview reference Manual and wrote the script above according to: &lt;A href="https://help.qlik.com/de-DE/qlikview/12.0/Subsystems/Client/Content/Scripting/ScriptControlStatements/If.htm" title="https://help.qlik.com/de-DE/qlikview/12.0/Subsystems/Client/Content/Scripting/ScriptControlStatements/If.htm"&gt;https://help.qlik.com/de-DE/qlikview/12.0/Subsystems/Client/Content/Scripting/ScriptControlStatements/If.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also found another Syntax here &lt;A href="https://community.qlik.com/thread/62297"&gt;IF &amp;amp;amp; Else condition&lt;/A&gt; :&lt;/P&gt;&lt;P&gt;Simple if function:&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor404"&gt;&lt;/A&gt;&lt;A name="if"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;if(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;condition , then , else&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Bold"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Bold"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tuan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 09:23:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-script-if-else-condition-in-dynamic-update-action/m-p/1206358#M625718</guid>
      <dc:creator />
      <dc:date>2016-11-03T09:23:44Z</dc:date>
    </item>
  </channel>
</rss>

