<?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 Calculation based on a satisfied condition in a different field? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779977#M668014</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the attached Excel file, I have records that are marked either with "In" or "Out" in the Exception column, with each record having a particular Delta value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want Qlikview to calculate 2 Delta averages based on whether a record is "In" or "Out".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result should be 2 values: one Delta average of ALL the "In" records, one Delta average of ALL the "Out" records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using an IF() statement: Avg(If(Exception='Out',Delta,0)) but the answer is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally, if Qlikview were averaging the "Outs" and came across an "In" it would simply skip it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Nov 2014 15:41:20 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-19T15:41:20Z</dc:date>
    <item>
      <title>Calculation based on a satisfied condition in a different field?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779977#M668014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the attached Excel file, I have records that are marked either with "In" or "Out" in the Exception column, with each record having a particular Delta value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want Qlikview to calculate 2 Delta averages based on whether a record is "In" or "Out".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result should be 2 values: one Delta average of ALL the "In" records, one Delta average of ALL the "Out" records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using an IF() statement: Avg(If(Exception='Out',Delta,0)) but the answer is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally, if Qlikview were averaging the "Outs" and came across an "In" it would simply skip it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 15:41:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779977#M668014</guid>
      <dc:creator />
      <dc:date>2014-11-19T15:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation based on a satisfied condition in a different field?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779978#M668015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;This should work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;avg( {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Exception&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'In'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Delta&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;avg( {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Exception&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {'Out'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Delta&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;IMG __jive_id="71664" alt="Capture.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/71664_Capture.PNG.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 16:03:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779978#M668015</guid>
      <dc:creator />
      <dc:date>2014-11-19T16:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation based on a satisfied condition in a different field?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779979#M668016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;YES! That worked great when I put the calculation in a pivot table. But is there a way I could put something like this in my load script? Qlikview doesn't seem to like the way the calculation is formatted in your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 16:20:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779979#M668016</guid>
      <dc:creator />
      <dc:date>2014-11-19T16:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation based on a satisfied condition in a different field?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779980#M668017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;You could create two seperate fields to sum:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[PO Number]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Delta&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Grouping&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;Exception&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'In', &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Delta&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;In_Delta&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;Exception&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Out', &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Delta&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Out_Delta&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Exception&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;[Sample Exception Report.xlsx]&lt;BR /&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ooxml&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;embedded&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;labels&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Sheet1); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Then just average the fields:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;IMG alt="Capture.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/71665_Capture.PNG.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 16:34:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779980#M668017</guid>
      <dc:creator />
      <dc:date>2014-11-19T16:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation based on a satisfied condition in a different field?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779981#M668018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fantastic, this rocks! Thank you so much Carly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 16:40:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779981#M668018</guid>
      <dc:creator />
      <dc:date>2014-11-19T16:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation based on a satisfied condition in a different field?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779982#M668021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can add aggregation in your script, you just need to be able to use the Group By to properly aggregate your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;E2:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[PO Number]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Grouping&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Exception&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&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;Exception&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'In', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Avg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Delta&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; )) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;In&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&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;Exception&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Out', &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Avg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Delta&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; )) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Out&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; E1&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Group&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;By&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[PO Number]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Grouping&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Exception&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 16:41:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-based-on-a-satisfied-condition-in-a-different-field/m-p/779982#M668021</guid>
      <dc:creator>oscar_ortiz</dc:creator>
      <dc:date>2014-11-19T16:41:51Z</dc:date>
    </item>
  </channel>
</rss>

