<?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: Function works through var but not through script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Function-works-through-var-but-not-through-script/m-p/1855585#M70622</link>
    <description>&lt;P&gt;Excellent, thanks! For future reference, you are missing a terminating semicolon on the end of the first command, and also a single quote&amp;nbsp; after the (varStart) of the second&lt;/P&gt;</description>
    <pubDate>Thu, 04 Nov 2021 14:41:17 GMT</pubDate>
    <dc:creator>gmenoutis</dc:creator>
    <dc:date>2021-11-04T14:41:17Z</dc:date>
    <item>
      <title>Function works through var but not through script</title>
      <link>https://community.qlik.com/t5/App-Development/Function-works-through-var-but-not-through-script/m-p/1855546#M70614</link>
      <description>&lt;P&gt;I have the following formula for a dollar-sign expansion with one parameter:&lt;/P&gt;
&lt;P&gt;pick(2+sign($(=only({1&amp;lt;[_MasterItemName]={'$1'}&amp;gt;} [_MasterItemExpression1]))),'#FF0000','#888888','#008800')&lt;/P&gt;
&lt;P&gt;If I enter this value exactly as is in the variable window of the edit-mode (I use a variable named &lt;STRONG&gt;color&lt;/STRONG&gt;), it works correctly: calling $(color(MasterItemName)) returns me what I want.&lt;/P&gt;
&lt;P&gt;But, I cannot seem to make this work if I do the variable assignment on-script. I've tried bot &lt;STRONG&gt;set&lt;/STRONG&gt; and &lt;STRONG&gt;let&lt;/STRONG&gt;, and both as seen above, and escaped the single quotes with two single quotes.&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 14:19:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Function-works-through-var-but-not-through-script/m-p/1855546#M70614</guid>
      <dc:creator>gmenoutis</dc:creator>
      <dc:date>2021-11-04T14:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Function works through var but not through script</title>
      <link>https://community.qlik.com/t5/App-Development/Function-works-through-var-but-not-through-script/m-p/1855576#M70620</link>
      <description>&lt;P&gt;Hi, loading expression from an excel file helps to avoid to use escape character for quotes and $, also helps to centralize maintenance.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Set-Analysis-in-Expression-Chart/m-p/187444#89749" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Dev/Set-Analysis-in-Expression-Chart/m-p/187444#89749&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In script maybe doesn't works because you also need to scape the $ character, in example you can use:&lt;/P&gt;
&lt;P&gt;set varStart =&amp;nbsp;&lt;SPAN&gt;pick(2+sign(&amp;amp;(=only({1&amp;lt;[_MasterItemName]={|&amp;amp;1|}&amp;gt;} [_MasterItemExpression1]))),|#FF0000|,|#888888|,|#008800|)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;let varEnd = replace(replace('$(varStart),'&amp;amp;','$'),'|',Chr(39));&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 14:29:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Function-works-through-var-but-not-through-script/m-p/1855576#M70620</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-11-04T14:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Function works through var but not through script</title>
      <link>https://community.qlik.com/t5/App-Development/Function-works-through-var-but-not-through-script/m-p/1855585#M70622</link>
      <description>&lt;P&gt;Excellent, thanks! For future reference, you are missing a terminating semicolon on the end of the first command, and also a single quote&amp;nbsp; after the (varStart) of the second&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 14:41:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Function-works-through-var-but-not-through-script/m-p/1855585#M70622</guid>
      <dc:creator>gmenoutis</dc:creator>
      <dc:date>2021-11-04T14:41:17Z</dc:date>
    </item>
  </channel>
</rss>

