<?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 Optimize if then else in expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Optimize-if-then-else-in-expression/m-p/398903#M148498</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have to optimize one expression on chart :&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13643889323397963" jivemacro_uid="_13643889323397963"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(sum({&amp;lt;Year={$(vCurrentYear)},Month={$(vCurrentMonth)},[Top]={"O"}&amp;gt;}[OD-Stock value]) &amp;lt;= sum({&amp;lt;Year={$(vYearBefore_MonthAfter)},Month={$(vMonthAfter)},[Top]={"O"}&amp;gt;}[OD-Sales]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum({&amp;lt;Year={$(vCurrentYear)},Month={$(vCurrentMonth)},[Top]={"O"}&amp;gt;}[OD-Stock value])*30/sum({&amp;lt;Year={$(vYearBefore_MonthAfter)},Month={$(vMonthAfter)},[Top]={"O"}&amp;gt;}[OD-Sales]),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(sum({&amp;lt;Year={$(vCurrentYear)},Month={$(vCurrentMonth)},[Top]={"O"}&amp;gt;}[OD-Stock value]) &amp;lt;= sum({&amp;lt;Year={$(vYearBefore_MonthAfter)},Month={$(vMonthAfter)},[Top]={"O"}&amp;gt;}[OD-Sales])&lt;/P&gt;&lt;P&gt;&amp;nbsp; +sum({&amp;lt;Year={$(vYearBefore_Month+2)},Month={$(vMois+2)},[Top]={"O"}&amp;gt;}[OD-Sales]),&lt;/P&gt;&lt;P&gt;((sum({&amp;lt;Year={$(vCurrentYear)},Month={$(vCurrentMonth)},[Top]={"O"}&amp;gt;}[OD-Stock value])-sum({&amp;lt;Year={$(vYearBefore_MonthAfter)},Month={$(vMonthAfter)},[Top]={"O"}&amp;gt;}[OD-Sales]))*30&lt;/P&gt;&lt;P&gt; /sum({&amp;lt;Year={$(vYearBefore_Month+2)},Month={$(vMois+2)},[Top]={"O"}&amp;gt;}[OD-Sales]))+30&lt;/P&gt;&lt;P&gt; ))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't do this test on the script, because the value depend of selection in application.&lt;/P&gt;&lt;P&gt;The variables vCurrentYear, ... are calculated with the current selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your suggestions.&lt;/P&gt;&lt;P&gt;Sophie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Mar 2013 12:58:49 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-03-27T12:58:49Z</dc:date>
    <item>
      <title>Optimize if then else in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Optimize-if-then-else-in-expression/m-p/398903#M148498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have to optimize one expression on chart :&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13643889323397963" jivemacro_uid="_13643889323397963"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(sum({&amp;lt;Year={$(vCurrentYear)},Month={$(vCurrentMonth)},[Top]={"O"}&amp;gt;}[OD-Stock value]) &amp;lt;= sum({&amp;lt;Year={$(vYearBefore_MonthAfter)},Month={$(vMonthAfter)},[Top]={"O"}&amp;gt;}[OD-Sales]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; sum({&amp;lt;Year={$(vCurrentYear)},Month={$(vCurrentMonth)},[Top]={"O"}&amp;gt;}[OD-Stock value])*30/sum({&amp;lt;Year={$(vYearBefore_MonthAfter)},Month={$(vMonthAfter)},[Top]={"O"}&amp;gt;}[OD-Sales]),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(sum({&amp;lt;Year={$(vCurrentYear)},Month={$(vCurrentMonth)},[Top]={"O"}&amp;gt;}[OD-Stock value]) &amp;lt;= sum({&amp;lt;Year={$(vYearBefore_MonthAfter)},Month={$(vMonthAfter)},[Top]={"O"}&amp;gt;}[OD-Sales])&lt;/P&gt;&lt;P&gt;&amp;nbsp; +sum({&amp;lt;Year={$(vYearBefore_Month+2)},Month={$(vMois+2)},[Top]={"O"}&amp;gt;}[OD-Sales]),&lt;/P&gt;&lt;P&gt;((sum({&amp;lt;Year={$(vCurrentYear)},Month={$(vCurrentMonth)},[Top]={"O"}&amp;gt;}[OD-Stock value])-sum({&amp;lt;Year={$(vYearBefore_MonthAfter)},Month={$(vMonthAfter)},[Top]={"O"}&amp;gt;}[OD-Sales]))*30&lt;/P&gt;&lt;P&gt; /sum({&amp;lt;Year={$(vYearBefore_Month+2)},Month={$(vMois+2)},[Top]={"O"}&amp;gt;}[OD-Sales]))+30&lt;/P&gt;&lt;P&gt; ))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't do this test on the script, because the value depend of selection in application.&lt;/P&gt;&lt;P&gt;The variables vCurrentYear, ... are calculated with the current selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your suggestions.&lt;/P&gt;&lt;P&gt;Sophie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Mar 2013 12:58:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimize-if-then-else-in-expression/m-p/398903#M148498</guid>
      <dc:creator />
      <dc:date>2013-03-27T12:58:49Z</dc:date>
    </item>
  </channel>
</rss>

