<?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: Reusable Expression Problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Reusable-Expression-Problem/m-p/978030#M644020</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep, that works Gysbert, Thank You!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Nov 2015 03:25:22 GMT</pubDate>
    <dc:creator>robinrouleur</dc:creator>
    <dc:date>2015-11-26T03:25:22Z</dc:date>
    <item>
      <title>Reusable Expression Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Reusable-Expression-Problem/m-p/978026#M644016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've managed to create the following reusable expression in the Document's Variable Overview editor but I can't work out how to define it using a LET/SET statement in the load script.&amp;nbsp; The problem is the requirement for single quotes arount the $1 argument.&amp;nbsp; I've tried every alternative for avoiding literal quotes that I can think of but nothing works.&amp;nbsp; Can anyone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chr(40)&amp;amp;Round(100*Sum($(='$1'&amp;amp;vShowDays))/Sum(ServiceRequests),1)&amp;amp;Chr(37)&amp;amp;Chr(41)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression takes an argument, eg "Reprocessed" and adds the postfix in the variable "vShowDays" ("14" or "60") to get the actual dimension name, eg "Reprocessed14".&amp;nbsp; It then sums it, converts to % and wraps the result in "(result%).&amp;nbsp; It works perfectly when created in the Variable Overview editor, I just can't find a way to define it in the load script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2015 05:58:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusable-Expression-Problem/m-p/978026#M644016</guid>
      <dc:creator>robinrouleur</dc:creator>
      <dc:date>2015-11-25T05:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reusable Expression Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Reusable-Expression-Problem/m-p/978027#M644017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET ETest = 'Chr(40)&amp;amp;Round(100*Sum($(='$1'&amp;amp;vShowDays))/Sum(ServiceRequests),1)&amp;amp;Chr(37)&amp;amp;Chr(41)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then $(ETest) when using it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2015 09:32:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusable-Expression-Problem/m-p/978027#M644017</guid>
      <dc:creator>Mark_Little</dc:creator>
      <dc:date>2015-11-25T09:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Reusable Expression Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Reusable-Expression-Problem/m-p/978028#M644018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vMyVar = &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Chr(40)&amp;amp;Round(100*Sum(@(='@1'&amp;amp;vShowDays))/Sum(ServiceRequests),1)&amp;amp;Chr(37)&amp;amp;Chr(41);&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: 13px;"&gt;LET vMyVar = Replace('$(vMyVar)','@','$');&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2015 09:39:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusable-Expression-Problem/m-p/978028#M644018</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-11-25T09:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reusable Expression Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Reusable-Expression-Problem/m-p/978029#M644019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thx Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That resuilts in: Chr(40)&amp;amp;Round(100*Sum()/Sum(ServiceRequests),1)&amp;amp;Chr(37)&amp;amp;Chr(41)&amp;nbsp; ie null inside first Sum().&lt;/P&gt;&lt;P&gt;I think this is because the single qiuotes are interpreted as string delimiters so we have two strings with a naked $1 in between.&amp;nbsp; The $1 and the enclosing $ expansion are both evaluated during the LET assignment and since $1 is not defined the $ expansion results in null.&amp;nbsp; The key problem seems to be that there is no way to prevent $ expansions from being evaluated during a SET/LET.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 02:36:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusable-Expression-Problem/m-p/978029#M644019</guid>
      <dc:creator>robinrouleur</dc:creator>
      <dc:date>2015-11-26T02:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Reusable Expression Problem</title>
      <link>https://community.qlik.com/t5/QlikView/Reusable-Expression-Problem/m-p/978030#M644020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep, that works Gysbert, Thank You!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 03:25:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reusable-Expression-Problem/m-p/978030#M644020</guid>
      <dc:creator>robinrouleur</dc:creator>
      <dc:date>2015-11-26T03:25:22Z</dc:date>
    </item>
  </channel>
</rss>

