<?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 Optimization Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Optimization-Expression/m-p/509899#M190547</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a chart that consume more ressources memory. I want to optimize this expression.&lt;/P&gt;&lt;P&gt;The Table that contains field KPI_Stock_PTF is a table Island with the rest of the model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension: &lt;/P&gt;&lt;P&gt;KPI_Stock_PTF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression: QTE&lt;/P&gt;&lt;P&gt;if&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;KPI_Stock_PTF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Total PTF',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_DISPO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_DIV&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_IMMO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_PER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_PROMO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_QUAR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;KPI_Stock_PTF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Flux Tendu',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$ &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FLUX&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'FSDE'},&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TYPEMARQUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'MN','MS'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ID_FOUR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;-={104,200,262}&amp;gt;}STK_PTF_DISPO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Flux Stocké',sum({$ &amp;lt;FLUX={'ENT'},&amp;nbsp; TYPEMARQUE={'MN','MS'}, ID_FOUR-={104,200,262}&amp;gt;}STK_PTF_DISPO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='MDD',sum({$ &amp;lt;TYPEMARQUE-={'MN','MS','MP-EXC'}, ID_FOUR-={104,200,262}&amp;gt;}STK_PTF_DISPO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Exclus',sum({$ &amp;lt;TYPEMARQUE={'MP-EXC'}, ID_FOUR-={104,200,262}&amp;gt;}STK_PTF_DISPO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Consommable',sum({$ &amp;lt;ID_FOUR={104,200,262}&amp;gt;}STK_PTF_DISPO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Quarantaine',sum(STK_PTF_QUAR),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Promotion',sum(STK_PTF_PROMO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Divers',sum(STK_PTF_PER+STK_PTF_IMMO+STK_PTF_DIV)&lt;BR /&gt;&lt;BR /&gt;)))))))))&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Is that more optimize to put into the script and how ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Jun 2013 08:06:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-06-26T08:06:29Z</dc:date>
    <item>
      <title>Optimization Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimization-Expression/m-p/509899#M190547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a chart that consume more ressources memory. I want to optimize this expression.&lt;/P&gt;&lt;P&gt;The Table that contains field KPI_Stock_PTF is a table Island with the rest of the model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension: &lt;/P&gt;&lt;P&gt;KPI_Stock_PTF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression: QTE&lt;/P&gt;&lt;P&gt;if&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;KPI_Stock_PTF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Total PTF',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_DISPO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_DIV&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_IMMO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_PER&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_PROMO&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;STK_PTF_QUAR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;KPI_Stock_PTF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='Flux Tendu',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({$ &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FLUX&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'FSDE'},&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;TYPEMARQUE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'MN','MS'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ID_FOUR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;-={104,200,262}&amp;gt;}STK_PTF_DISPO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Flux Stocké',sum({$ &amp;lt;FLUX={'ENT'},&amp;nbsp; TYPEMARQUE={'MN','MS'}, ID_FOUR-={104,200,262}&amp;gt;}STK_PTF_DISPO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='MDD',sum({$ &amp;lt;TYPEMARQUE-={'MN','MS','MP-EXC'}, ID_FOUR-={104,200,262}&amp;gt;}STK_PTF_DISPO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Exclus',sum({$ &amp;lt;TYPEMARQUE={'MP-EXC'}, ID_FOUR-={104,200,262}&amp;gt;}STK_PTF_DISPO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Consommable',sum({$ &amp;lt;ID_FOUR={104,200,262}&amp;gt;}STK_PTF_DISPO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Quarantaine',sum(STK_PTF_QUAR),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Promotion',sum(STK_PTF_PROMO),&lt;BR /&gt;&lt;BR /&gt;if(KPI_Stock_PTF='Divers',sum(STK_PTF_PER+STK_PTF_IMMO+STK_PTF_DIV)&lt;BR /&gt;&lt;BR /&gt;)))))))))&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Is that more optimize to put into the script and how ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 08:06:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimization-Expression/m-p/509899#M190547</guid>
      <dc:creator />
      <dc:date>2013-06-26T08:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Optimization Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimization-Expression/m-p/509900#M190548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also build KPIs like this, where the table containing the dimensions is not connected to the rest of the datamodel. I've not seen any optimisation issues with it yet.&lt;/P&gt;&lt;P&gt;Perhaps comment out the various lines to see whether it is one or more of these KPIs that is specifically causing you performance problems. Are any of these KPIs returning an unfiltered/global result, suggesting a link is broken and the calculaton engine is taking time to sum up all of a fields the records.&lt;/P&gt;&lt;P&gt;Something else to watch for is where the fields used in a KPI's calculation are spread across too many links in the datamodel. For instance, for the Flux Tendu KPI, are FLUX TYPEMARQUE, ID_FOUR and STK_PTF_DISPO spread across the datamodel, or occuring on adjacent tables. QlikView should be able to handle spead out data of course, but may take longer to associate it.&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 08:18:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimization-Expression/m-p/509900#M190548</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-26T08:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Optimization Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimization-Expression/m-p/509901#M190549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try a pick-match combination instead of the nested if's. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pick(match(KPI_Stock_PTF, 'Total' ,'Flux Tendu',..etc ,'Divers'), &lt;EM&gt;sum_expression_for_total_here&lt;/EM&gt;, &lt;EM&gt;sum_expression_for_fluxtendu_here&lt;/EM&gt;, ...etc, &lt;EM&gt;sum_expression_for_divers_here&lt;/EM&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 09:03:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimization-Expression/m-p/509901#M190549</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-06-26T09:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Optimization Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimization-Expression/m-p/509902#M190550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank Jonathan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank Gysbert for your expression but the memoy (KB) is the same. If function or Pikck function : 6128 KB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 12:08:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimization-Expression/m-p/509902#M190550</guid>
      <dc:creator />
      <dc:date>2013-06-26T12:08:01Z</dc:date>
    </item>
  </channel>
</rss>

