<?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 AVG and SUM functions reside on the same expression? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342017#M491917</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have set of KPI definition that should be evaluated "on the fly" using dollar expansion and presented in straight table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SOURCE &lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13443330896787477" jivemacro_uid="_13443330896787477"&gt;&lt;P&gt;KPI:&lt;/P&gt;&lt;P&gt;LOAD INLINE * [&lt;/P&gt;&lt;P&gt;[KPI ID], [KPI Definition]&lt;/P&gt;&lt;P&gt;1, 'AVG([KPI Value])'&lt;/P&gt;&lt;P&gt;2, 'AVG([KPI Value])'&lt;/P&gt;&lt;P&gt;3, 'SUM([KPI Value])' &lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KPIValue:&lt;/P&gt;&lt;P&gt;LOAD [KPI ID]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[KPI Value]&lt;/P&gt;&lt;P&gt;RESIDENT KPI_Value; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Straight table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension: &lt;/P&gt;&lt;P&gt;- KPI ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;$(=&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;[KPI Definition]&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem: calculation of the expression fails when it try to calculated KPI 3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea's how i can solve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Aug 2012 09:56:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-08-07T09:56:32Z</dc:date>
    <item>
      <title>AVG and SUM functions reside on the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342017#M491917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have set of KPI definition that should be evaluated "on the fly" using dollar expansion and presented in straight table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SOURCE &lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13443330896787477" jivemacro_uid="_13443330896787477"&gt;&lt;P&gt;KPI:&lt;/P&gt;&lt;P&gt;LOAD INLINE * [&lt;/P&gt;&lt;P&gt;[KPI ID], [KPI Definition]&lt;/P&gt;&lt;P&gt;1, 'AVG([KPI Value])'&lt;/P&gt;&lt;P&gt;2, 'AVG([KPI Value])'&lt;/P&gt;&lt;P&gt;3, 'SUM([KPI Value])' &lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KPIValue:&lt;/P&gt;&lt;P&gt;LOAD [KPI ID]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[KPI Value]&lt;/P&gt;&lt;P&gt;RESIDENT KPI_Value; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Straight table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension: &lt;/P&gt;&lt;P&gt;- KPI ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;$(=&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;[KPI Definition]&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem: calculation of the expression fails when it try to calculated KPI 3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea's how i can solve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 09:56:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342017#M491917</guid>
      <dc:creator />
      <dc:date>2012-08-07T09:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: AVG and SUM functions reside on the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342018#M491918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this app...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 11:28:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342018#M491918</guid>
      <dc:creator />
      <dc:date>2012-08-07T11:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: AVG and SUM functions reside on the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342019#M491919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;$(=&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif;"&gt;[KPI Definition]&lt;/SPAN&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;), [KPI ID])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 17:42:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342019#M491919</guid>
      <dc:creator>chematos</dc:creator>
      <dc:date>2012-08-07T17:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: AVG and SUM functions reside on the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342020#M491920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the only way to create a dynamic expression is to use a pick() / match () combination:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=pick(&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;KPIID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$(=concat(KPIDefinition,','))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also attached,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 19:02:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342020#M491920</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-07T19:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: AVG and SUM functions reside on the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342021#M491921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works. but... If you select KPI 3, you'll end up with null. KPI 1 &amp;amp; 2 work fine &lt;IMG __jive_id="19508" class="jive-image" alt="Knipsel.PNG" src="https://community.qlik.com/legacyfs/online/19508_Knipsel.PNG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 19:21:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342021#M491921</guid>
      <dc:creator />
      <dc:date>2012-08-07T19:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: AVG and SUM functions reside on the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342022#M491922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;pick(&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;KPIID,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$(=concat(&lt;STRONG&gt;{1} &lt;/STRONG&gt;KPIDefinition,','))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to make the concat indepent from selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: see also &lt;A _jive_internal="true" href="https://community.qlik.com/thread/59081?tstart=0"&gt;http://community.qlik.com/thread/59081&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 19:26:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342022#M491922</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-07T19:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: AVG and SUM functions reside on the same expression?</title>
      <link>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342023#M491923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, guys. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The pick method worked like a charm. THANKS!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 07:18:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AVG-and-SUM-functions-reside-on-the-same-expression/m-p/342023#M491923</guid>
      <dc:creator />
      <dc:date>2012-08-08T07:18:44Z</dc:date>
    </item>
  </channel>
</rss>

