<?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 If Statement Set Analysis Evaluation Order Error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Statement-Set-Analysis-Evaluation-Order-Error/m-p/1123136#M369962</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create a view of a P&amp;amp;L that compares the selected level of review (for example, a 'Region' within the company) against the parent. In this case, 'Region' rolls up to 'Area' and 'Area' rolls to 'Company'. I've written the variable below to try to create this and I'm getting a 0 value when Qlikview is evaluating it. I'm not advanced enough to know how Qlik evaluates the formula, so if anyone can help me figure this out I'd appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14629746856197222" jivemacro_uid="_14629746856197222"&gt;
&lt;P style="font-size: 13.3333px;"&gt;SET vPLActualAmountYTD1 =&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; If($(vAreaReview) = 1, //vAreaReview evaluates the current selections to determine which parent to display&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; SUM({1&amp;lt;[Company] = {'$(vCompany)'}, [FiscYTDAcctgFlag]={1}&amp;gt;} ActualAmount), //&lt;SPAN style="font-size: 13.3333px;"&gt;If we are reviewing at the Area level, c&lt;/SPAN&gt;alculate the amount at the Company level (Area rolls to Company)&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; SUM({1&amp;lt;[Area] = {'$(vArea)'}, [FiscYTDAcctgFlag]={1}&amp;gt;} ActualAmount) //If we are not at the area level, we are reviewing a Region, so calculate the amount at the Area level&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; );&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the formula above, vCompany and vArea are variables that capture the parent of the selected level of review. In my app, I have conditional display on the calculations so that a single Area or Region has to be selected, and therefore a single parent is available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the chart, I want to use $(vPLActualAmountYTD1) as my expression. Again, any help would be appreciated. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 May 2016 13:55:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-05-11T13:55:15Z</dc:date>
    <item>
      <title>If Statement Set Analysis Evaluation Order Error</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statement-Set-Analysis-Evaluation-Order-Error/m-p/1123136#M369962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create a view of a P&amp;amp;L that compares the selected level of review (for example, a 'Region' within the company) against the parent. In this case, 'Region' rolls up to 'Area' and 'Area' rolls to 'Company'. I've written the variable below to try to create this and I'm getting a 0 value when Qlikview is evaluating it. I'm not advanced enough to know how Qlik evaluates the formula, so if anyone can help me figure this out I'd appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14629746856197222" jivemacro_uid="_14629746856197222"&gt;
&lt;P style="font-size: 13.3333px;"&gt;SET vPLActualAmountYTD1 =&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; If($(vAreaReview) = 1, //vAreaReview evaluates the current selections to determine which parent to display&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; SUM({1&amp;lt;[Company] = {'$(vCompany)'}, [FiscYTDAcctgFlag]={1}&amp;gt;} ActualAmount), //&lt;SPAN style="font-size: 13.3333px;"&gt;If we are reviewing at the Area level, c&lt;/SPAN&gt;alculate the amount at the Company level (Area rolls to Company)&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; SUM({1&amp;lt;[Area] = {'$(vArea)'}, [FiscYTDAcctgFlag]={1}&amp;gt;} ActualAmount) //If we are not at the area level, we are reviewing a Region, so calculate the amount at the Area level&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; );&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the formula above, vCompany and vArea are variables that capture the parent of the selected level of review. In my app, I have conditional display on the calculations so that a single Area or Region has to be selected, and therefore a single parent is available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the chart, I want to use $(vPLActualAmountYTD1) as my expression. Again, any help would be appreciated. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2016 13:55:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statement-Set-Analysis-Evaluation-Order-Error/m-p/1123136#M369962</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-11T13:55:15Z</dc:date>
    </item>
  </channel>
</rss>

