<?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: Performance in expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190445#M384764</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;Thank for your reply.&lt;/P&gt;&lt;P&gt;Yes that's correct. It's calculated too early from external source (excel).&lt;/P&gt;&lt;P&gt;And the string is the LET assignment&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RObert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Sep 2016 08:40:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-09-23T08:40:35Z</dc:date>
    <item>
      <title>Performance in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190439#M384758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an performance issue with an expression in the calculation function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 681px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="63" width="681"&gt;if(^Exp_Curr='USD', sum(Omzet_USD)&lt;BR /&gt; ,if(^Exp_Curr='GBP',sum(Omzet_GBP)&lt;BR /&gt; ,sum(Omzet_EUR)))&lt;BR /&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;^Exp_Curr is a picking field for currency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This &lt;SPAN style="text-decoration: underline;"&gt;if construction&lt;/SPAN&gt; causes performance issue's, I can see multi blogs around this problem. &lt;/P&gt;&lt;P&gt;What's the best way for solving this calculation in a different way? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 11:54:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190439#M384758</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-22T11:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190440#M384759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't imagine why this expression would cause performance problems (if you're not placing the IF() inside the Sum() function call), but you can always try defining a variable called for example &lt;SPAN style="font-family: 'courier new', courier;"&gt;vCurrencySelector&lt;/SPAN&gt; as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;^Exp_Curr&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and change your expression into something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=sum(Omzet_$(vCurrencySelector))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ignore the red wiggly lines in the expression eduitor; the syntax checker doesn't understand what you mean, but it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 11:58:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190440#M384759</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-09-22T11:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190441#M384760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Architect here to help on solving this issue &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;Usually on of the best practices in developing a dashboard is to bring the most complexity to the script and avoid using a calculated Dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do to solve this is to do something like this in your script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Omzet_USD)*Flag_USD as Currency_USD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Omzet_GBP)*Flag_GBP as Currency_GBP,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(Omzet_EUR)*Flag_EUR as Currency_EUR;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if([^Exp_Curr] = 'USD', 1, 0) as Flag_USD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if([^Exp_Curr] = 'GBP', 1, 0) as Flag_GBP,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if([^Exp_Curr] = 'EUR', 1, 0) as Flag_EUR;&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM [your connection to your database goes here];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;D.A. MB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 12:04:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190441#M384760</guid>
      <dc:creator>miguelbraga</dc:creator>
      <dc:date>2016-09-22T12:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190442#M384761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;Thanks,. That worked fine!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2016 12:49:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190442#M384761</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-22T12:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190443#M384762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the answer. It works when I put the calculation &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 12px; background-color: #edf8ca;"&gt;sum(Omzet_$(vCurrencySelector)) in the chart expression. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 12px; background-color: #edf8ca;"&gt;But i'm using a variable as expression ($(vSalesCurrency)) &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 12px; background-color: #edf8ca;"&gt;and this variable is already loaded in the script using the Include statement so I can't be calculated dynamically. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 12px; background-color: #edf8ca;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It there a way to calculated the expression with the included statement?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 08:07:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190443#M384762</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-23T08:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190444#M384763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you experiencing $-sign expansion at the wrong moment, e.g. too early? That can be handled as well (there are many techniques available, all of them delaying $-sign expansion) but to show you how it would work in your environment, we need to know how you define these variables in your script. Do you load them from from an external source? Do you assemble them with SRT/LET string assignments?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 08:35:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190444#M384763</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-09-23T08:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190445#M384764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;Thank for your reply.&lt;/P&gt;&lt;P&gt;Yes that's correct. It's calculated too early from external source (excel).&lt;/P&gt;&lt;P&gt;And the string is the LET assignment&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RObert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 08:40:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190445#M384764</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-23T08:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Performance in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190446#M384765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should delay the $-substitution by replacing the $-sign in your Excel source by something else (a pound sign # for example) and restoring the $-signs in your script immediately before creating the expression variable using a Replace() function call. If you do not want to change your Excel source, use two Replace() calls to translate $-signs into something else during first load, and to restore $-signs during final vairable assignment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whatever you do inbetween these two steps won't affect the part that is to be substituted during expression evaluation in your objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want an example, post the script part that handles Excel input and variable creation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 10:05:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Performance-in-expression/m-p/1190446#M384765</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-09-23T10:05:03Z</dc:date>
    </item>
  </channel>
</rss>

