<?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: if expression within another if in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483095#M180534</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if you select a single year, say 2012, then since you only selected one year it should always be 0?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you select 2012 and 2014, then this should do sum(2014)/sum(2012) if 2014 is not zero, else it should be 0?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure how you want the formula to behavior with your selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you give me the scenarios of what you want when:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2012 is selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2012 and 2014 is selected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2013 and 2014 is selected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else if you want to post sample qvw with dummy data that demonstrates your problem, I would be able to help you quicker.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Jan 2014 20:27:45 GMT</pubDate>
    <dc:creator>jerem1234</dc:creator>
    <dc:date>2014-01-08T20:27:45Z</dc:date>
    <item>
      <title>if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483086#M180525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to put multiple conditions "if" inside another "if", where this condition have values ​​in the years 2012, 2013 and 2014, but if 2014 is zero the formula should be made using the values ​​of 2012 and 2013, put up in 2014 is not zero the formula must be made using 2013 and 2014.&lt;/P&gt;&lt;P&gt;As follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(if(ANO=year(today()),VALOR_CONTABIL=0,sum(if(ANO=year(today())-1,VALOR_CONTABIL))/sum(if(ANO=year(today())-2,VALOR_CONTABIL)))-1), (sum(if(ANO=year(today()),VALOR_CONTABIL))/sum(if(ANO=year(today())-1,VALOR_CONTABIL)))-1)&lt;/P&gt;&lt;P&gt;&lt;OBJECT height="0" type="application/gas-events-bb" width="0"&gt;&lt;/OBJECT&gt;&lt;OBJECT height="0" type="application/gas-events-abn" width="0"&gt;&lt;/OBJECT&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 14:06:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483086#M180525</guid>
      <dc:creator />
      <dc:date>2014-01-08T14:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483087#M180526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this would do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(sum({&amp;lt;ANO = {$(=year(today()))}&amp;gt;}VALOR_CONTABIL)=0,sum({&amp;lt;ANO = {$(=year(today())-1)}&amp;gt;}VALOR_CONTABIL)/sum({&amp;lt;ANO= {$(=year(today())-2)}&amp;gt;}VALOR_CONTABIL)-1,&lt;/P&gt;&lt;P&gt;sum({&amp;lt;ANO = {$(=year(today()))}&amp;gt;}VALOR_CONTABIL)/sum({&amp;lt;ANO = {$(=year(today())-1)}&amp;gt;}VALOR_CONTABIL)-1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not, could you post a sample qvw demonstrating your problem or some mock data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Might be just making adjustments to this equation here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 14:23:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483087#M180526</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-01-08T14:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483088#M180527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vinicius,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I came across this website which helps with generating nested IF statements. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.qlikblog.at/tools/Nested-If-Generator.html" style="font-size: 10pt; line-height: 1.5em;"&gt;http://www.qlikblog.at/tools/Nested-If-Generator.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps. Please mark as helpful if so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 16:12:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483088#M180527</guid>
      <dc:creator>mjm</dc:creator>
      <dc:date>2014-01-08T16:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483089#M180528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jerem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Esta formula funciona, porem se eu selecionar 2012 e 2013, a formula deveria entender que 2014 inteiro é nulo, pois não foi selecionado, mas a formula está entendendo que tem numero, pois conta no BD informação para 2014.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(sum({&amp;lt;ANO={$(=year(today()))}&amp;gt;} VALOR_CONTABIL)=0,sum({&amp;lt;ANO={$(=year(today())-1)}&amp;gt;} VALOR_CONTABIL)/sum({&amp;lt;ANO={$(=year(today())-2)}&amp;gt;} VALOR_CONTABIL)-1,&lt;/P&gt;&lt;P&gt;sum({&amp;lt;ANO={$(=year(today()))}&amp;gt;} VALOR_CONTABIL)/sum({&amp;lt;ANO={$(=year(today())-1)}&amp;gt;} VALOR_CONTABIL)-1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 17:34:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483089#M180528</guid>
      <dc:creator />
      <dc:date>2014-01-08T17:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483090#M180529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Não consegui utilizar este link&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 17:34:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483090#M180529</guid>
      <dc:creator />
      <dc:date>2014-01-08T17:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483091#M180530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe add an extra criteria to your if statement like you had before:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=if(sum({&amp;lt;ANO = {$(=year(today()))}&amp;gt;}VALOR_CONTABIL)=0 &lt;STRONG&gt;and &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;ANO=year(today())&lt;/STRONG&gt;&lt;/SPAN&gt;,sum({&amp;lt;ANO = {$(=year(today())-1)}&amp;gt;}VALOR_CONTABIL)/sum({&amp;lt;ANO= {$(=year(today())-2)}&amp;gt;}VALOR_CONTABIL)-1,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum({&amp;lt;ANO = {$(=year(today()))}&amp;gt;}VALOR_CONTABIL)/sum({&amp;lt;ANO = {$(=year(today())-1)}&amp;gt;}VALOR_CONTABIL)-1)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 17:40:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483091#M180530</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-01-08T17:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483092#M180531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With this condition the formula is locked in the current year, the need is it to do the calculation for the mobile year.&lt;/P&gt;&lt;P&gt;I choose the year you want to calculate the% if I do not choose the formula considers the condition of formula&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; X&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2012&amp;nbsp;&amp;nbsp;&amp;nbsp; 2013&amp;nbsp;&amp;nbsp;&amp;nbsp; 2014&amp;nbsp;&amp;nbsp; Formula (IF)%&lt;/P&gt;&lt;P&gt;Jan&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50%&lt;/P&gt;&lt;P&gt;Feb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100%&lt;/P&gt;&lt;P&gt;Mar&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 87.5%&lt;/P&gt;&lt;P&gt;Apr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -27.3%&lt;/P&gt;&lt;P&gt;May&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -58.3%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if in Excel formula would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= IF (D13 = 0; (C13/B13) -1; (D13/C13) -1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Column B = 2012&lt;/P&gt;&lt;P&gt;Column C = 2013&lt;/P&gt;&lt;P&gt;Column D = 2014&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But Qlik this formula should respect the national team of the year, if I select 2012 and 2013 to formulate the month JAN return 100%&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 18:11:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483092#M180531</guid>
      <dc:creator />
      <dc:date>2014-01-08T18:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483093#M180532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here try this formula out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ANO&lt;/SPAN&gt; = {$(=max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ANO&lt;/SPAN&gt;))}&amp;gt;}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;VALOR_CONTABIL&lt;/SPAN&gt;)=0,sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ANO&lt;/SPAN&gt; = {$(=max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ANO&lt;/SPAN&gt;)-1)}&amp;gt;}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;VALOR_CONTABIL&lt;/SPAN&gt;)/sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ANO&lt;/SPAN&gt;= {$(=max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ANO&lt;/SPAN&gt;)-2)}&amp;gt;}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;VALOR_CONTABIL&lt;/SPAN&gt;)-1,&lt;/P&gt;&lt;P&gt;sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ANO&lt;/SPAN&gt; = {$(=max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ANO&lt;/SPAN&gt;))}&amp;gt;}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;VALOR_CONTABIL&lt;/SPAN&gt;)/sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ANO&lt;/SPAN&gt; = {$(=max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ANO&lt;/SPAN&gt;)-1)}&amp;gt;}&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;VALOR_CONTABIL&lt;/SPAN&gt;)-1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully this one does the job.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 18:44:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483093#M180532</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-01-08T18:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483094#M180533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One part went well, however if I select 2012 x 2014 or 2013 x 2014, the formula has to respect the national team, and is not happening. Another thing, if the selection is a single year "2012", the formula does not return anything, because the result is zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="mobile test year.png" class="jive-image" src="/legacyfs/online/51267_mobile test year.png" style="width: 620px; height: 271px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 19:44:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483094#M180533</guid>
      <dc:creator />
      <dc:date>2014-01-08T19:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483095#M180534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if you select a single year, say 2012, then since you only selected one year it should always be 0?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you select 2012 and 2014, then this should do sum(2014)/sum(2012) if 2014 is not zero, else it should be 0?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure how you want the formula to behavior with your selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you give me the scenarios of what you want when:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2012 is selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2012 and 2014 is selected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2013 and 2014 is selected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else if you want to post sample qvw with dummy data that demonstrates your problem, I would be able to help you quicker.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 20:27:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483095#M180534</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-01-08T20:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483096#M180535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let the answer to a solution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Selecting an isolated year 2012 or 2013 or 214, the return shall be zero (0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Selecting 2012 x 2013, the formula does the calculation between (2013/2012),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Selecting 2012 x 2014, the formula does the calculation between (2014/2012),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Selecting 2013 x 2014, the formula does the calculation from 2014/2013.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 11:18:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483096#M180535</guid>
      <dc:creator />
      <dc:date>2014-01-09T11:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483097#M180536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this one and see if it fits your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(GetSelectedCount(ANO)=0 or GetSelectedCount(ANO)&amp;gt;2, &lt;/P&gt;&lt;P&gt;if(sum({&amp;lt;ANO = {$(=max(ANO))}&amp;gt;}VALOR_CONTABIL)=0,sum({&amp;lt;ANO = {$(=max(ANO)-1)}&amp;gt;}VALOR_CONTABIL)/sum({&amp;lt;ANO= {$(=max(ANO)-2)}&amp;gt;}VALOR_CONTABIL)-1,sum({&amp;lt;ANO = {$(=max(ANO))}&amp;gt;}VALOR_CONTABIL)/sum({&amp;lt;ANO = {$(=max(ANO)-1)}&amp;gt;}VALOR_CONTABIL)-1),&lt;/P&gt;&lt;P&gt;if(sum({&amp;lt;ANO = {$(=max(ANO))}&amp;gt;}VALOR_CONTABIL)&amp;lt;&amp;gt;0, sum({&amp;lt;ANO = {$(=max(ANO))}&amp;gt;}VALOR_CONTABIL)/sum({&amp;lt;ANO= {$(=min(ANO))}&amp;gt;}VALOR_CONTABIL)-1, 0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 18:59:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483097#M180536</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-01-09T18:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483098#M180537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you friend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This formula did the calculation correctly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 20:16:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483098#M180537</guid>
      <dc:creator />
      <dc:date>2014-01-09T20:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483099#M180538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jerem friend&lt;/P&gt;&lt;P&gt;There's one more detail that this formula must include, in addition to any conditions that the formula considers to do the calculations, we have one more:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Totals (2012, 2013, 2014) are classified by segment, ie, segment 1, 2, 3. Each one means a product line, and the formula has to respeirar segment included in the formula to make all other calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='TOTAL:&amp;nbsp; '&amp;amp;Num(if(LINHA='2', IF(GetSelectedCount(ANO)=0 or GetSelectedCount(ANO)&amp;gt;2,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(sum({&amp;lt;ANO={$(=max(ANO))}&amp;gt;}QTDE_LITROS_CAIXA/100)=0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; (sum({&amp;lt;ANO={$(=max(ANO)-1)}&amp;gt;}QTDE_LITROS_CAIXA/100)/sum({&amp;lt;ANO={$(=max(ANO)-2)}&amp;gt;}QTDE_LITROS_CAIXA/100)-1)*100,&lt;/P&gt;&lt;P&gt;&amp;nbsp; (sum({&amp;lt;ANO={$(=max(ANO))}&amp;gt;}QTDE_LITROS_CAIXA/100)/sum({&amp;lt;ANO={$(=max(ANO)-1)}&amp;gt;}QTDE_LITROS_CAIXA/100)-1)*100),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(sum({&amp;lt;ANO={$(=max(ANO))}&amp;gt;}QTDE_LITROS_CAIXA/100)&amp;lt;&amp;gt;0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; (sum({&amp;lt;ANO={$(=max(ANO))}&amp;gt;}QTDE_LITROS_CAIXA/100)/sum({&amp;lt;ANO={$(=min(ANO))}&amp;gt;}QTDE_LITROS_CAIXA/100)-1)*100,0)),0),'##,#')&amp;amp;'%'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 16:38:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483099#M180538</guid>
      <dc:creator />
      <dc:date>2014-01-10T16:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483100#M180539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this example if I do not select any segment the number is zero, however the formula should respect the segment in-built in it and return the correct calculation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 16:39:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483100#M180539</guid>
      <dc:creator />
      <dc:date>2014-01-10T16:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: if expression within another if</title>
      <link>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483101#M180540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning, already managed to fix this formula.&lt;/P&gt;&lt;P&gt;See how it fits:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='TOTAL:&amp;nbsp; '&amp;amp;Num (if(GetSelectedCount(ANO)=0 or GetSelectedCount(ANO)&amp;gt;2,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(sum({&amp;lt;ANO={$(=max(ANO))}&amp;gt;}IF(LINHA='2',QTDE_LITROS_CAIXA/100))=0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; (sum({&amp;lt;ANO={$(=max(ANO)-1)}&amp;gt;}IF(LINHA='2',QTDE_LITROS_CAIXA/100))/sum({&amp;lt;ANO={$(=max(ANO)-2)}&amp;gt;}IF(LINHA='2',QTDE_LITROS_CAIXA/100))-1)*100,&lt;/P&gt;&lt;P&gt;&amp;nbsp; (sum({&amp;lt;ANO={$(=max(ANO))}&amp;gt;}IF(LINHA='2',QTDE_LITROS_CAIXA/100))/sum({&amp;lt;ANO={$(=max(ANO)-1)}&amp;gt;}IF(LINHA='2',QTDE_LITROS_CAIXA/100))-1)*100),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(sum({&amp;lt;ANO={$(=max(ANO))}&amp;gt;}IF(LINHA='2',QTDE_LITROS_CAIXA/100))&amp;lt;&amp;gt;0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; (sum({&amp;lt;ANO={$(=max(ANO))}&amp;gt;}IF(LINHA='2',QTDE_LITROS_CAIXA/100))/sum({&amp;lt;ANO={$(=min(ANO))}&amp;gt;}IF(LINHA='2',QTDE_LITROS_CAIXA/100))-1)*100,0)),'##,##')&amp;amp;'%'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Jan 2014 11:49:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-expression-within-another-if/m-p/483101#M180540</guid>
      <dc:creator />
      <dc:date>2014-01-11T11:49:21Z</dc:date>
    </item>
  </channel>
</rss>

