<?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 is nested if allowed in Average()? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156215#M890360</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi qlik folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am given a line chart created by nested if statements as below. I need to create a reference line of average in the chart but I get&lt;/P&gt;&lt;P&gt;'Allocated Memory Exceeded' error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way I can create the average line using nested if statements at all? (Note that I am not allowed to change the expression of the chart).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>is nested if allowed in Average()?</title>
      <link>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156215#M890360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi qlik folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am given a line chart created by nested if statements as below. I need to create a reference line of average in the chart but I get&lt;/P&gt;&lt;P&gt;'Allocated Memory Exceeded' error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way I can create the average line using nested if statements at all? (Note that I am not allowed to change the expression of the chart).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156215#M890360</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: is nested if allowed in Average()?</title>
      <link>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156216#M890361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The number of nested if statements is probably causing the problem. Perhaps using the pick function works better:&lt;/P&gt;&lt;P&gt;pick([Sys KPI Number], ...first expression... , ...second expression... , ...etc)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 12:10:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156216#M890361</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-08-23T12:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: is nested if allowed in Average()?</title>
      <link>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156217#M890362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quite often are nested if-loops a nightmare from a performance and developing/maintaining point of view and shouldn't be used so heavily like in your example. I think you will need to change these expression at least by replacing the if-loop with something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pick(match([Sys KPI Number], 1,2,3,....),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exp1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exp2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 12:12:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156217#M890362</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-08-23T12:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: is nested if allowed in Average()?</title>
      <link>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156218#M890363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus &amp;amp; Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your inputs. Your suggestions has significantly simplified the script and I'm happy about it. However, the expression doesn't accept the Average function. I tested it in a textbox which give me this message "Error is expression: Nested aggregation not allowed". Any idea?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 13:52:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156218#M890363</guid>
      <dc:creator />
      <dc:date>2016-08-23T13:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: is nested if allowed in Average()?</title>
      <link>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156219#M890364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For neseted aggregations you need to wrap them with an aggr-function like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(&lt;/P&gt;&lt;P&gt;pick(match([Sys KPI Number], 1,2,3,....),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exp1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exp2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...),&lt;/P&gt;&lt;P&gt;Dim1, Dim2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whereby you need to specify the dimensions to which the expressions should be related to (normally those dimensions which are included in your chart).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 15:21:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156219#M890364</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-08-23T15:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: is nested if allowed in Average()?</title>
      <link>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156220#M890365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have you tried&lt;/P&gt;&lt;P&gt;Aggr ( &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF's &lt;/P&gt;&lt;P&gt;&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; , ChartDimension)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;preferably use Pick Match as Marcus has suggested&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 08:28:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156220#M890365</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2016-08-24T08:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: is nested if allowed in Average()?</title>
      <link>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156221#M890366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for this &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 08:41:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/is-nested-if-allowed-in-Average/m-p/1156221#M890366</guid>
      <dc:creator />
      <dc:date>2016-08-24T08:41:44Z</dc:date>
    </item>
  </channel>
</rss>

