<?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 Need help with calculations in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-help-with-calculations/m-p/1267996#M853284</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 12pt;"&gt;Hi All,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 12pt;"&gt;I am new to qlikview. Trying to create a straight table that shows the KPI value for the selected month and trend for the last 12 months.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="154490" alt="Picture1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/154490_Picture1.png" style="height: 344px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12pt;"&gt;However, I am having the below issues:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #333333;"&gt;&lt;SPAN style="font-family: Arial;"&gt;•&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; Measure Names should be&amp;nbsp; filtered for the selected ‘Measure Domain’.&amp;nbsp; Currently the table is showing all the measure names, not filtering for the measure domain selection.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #333333;"&gt;&lt;SPAN style="font-family: Arial;"&gt;•&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;KPI value is also not changing based on &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;AreaID&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; selection. It is showing the same value for all the &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;AreaID&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; selected.&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KPI value =&amp;nbsp; if (DataType = 'Percent', Num( avg( KPI_Value), '#,#0.0%'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if (DataType = 'Number', Num( avg( KPI_Value), '#,##0')))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12pt; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #333333;"&gt;&lt;SPAN style="font-family: Arial;"&gt;•&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; The KPI trend shows the last 12 month trend.&amp;nbsp; I am using the below expression.&amp;nbsp; I want to display to display whatever the existing values for the 12 months without averaging. However, the set analysis expression is asking for a aggregation (sum/&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;avg&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; etc.)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #333333;"&gt;&lt;SPAN style="font-family: Arial;"&gt;•&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;avg&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;({1 &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;PeriodKey_End&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; = {"$(='&amp;gt;' &amp;amp; Date(&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;AddYears&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;(Max(&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;PeriodKey_End&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;), -1), 'YYYY-MM-DD') &amp;amp; '&amp;lt;=' &amp;amp; Date(Max(&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;PeriodKey_End&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;), 'YYYY-MM-DD'))"}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;KPI_Value&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Calibri;"&gt;) &lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I ma attaching the sample qvw file. Please can you help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Need help with calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-calculations/m-p/1267996#M853284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 12pt;"&gt;Hi All,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 12pt;"&gt;I am new to qlikview. Trying to create a straight table that shows the KPI value for the selected month and trend for the last 12 months.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="154490" alt="Picture1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/154490_Picture1.png" style="height: 344px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12pt;"&gt;However, I am having the below issues:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #333333;"&gt;&lt;SPAN style="font-family: Arial;"&gt;•&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; Measure Names should be&amp;nbsp; filtered for the selected ‘Measure Domain’.&amp;nbsp; Currently the table is showing all the measure names, not filtering for the measure domain selection.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #333333;"&gt;&lt;SPAN style="font-family: Arial;"&gt;•&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;KPI value is also not changing based on &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;AreaID&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; selection. It is showing the same value for all the &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;AreaID&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; selected.&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KPI value =&amp;nbsp; if (DataType = 'Percent', Num( avg( KPI_Value), '#,#0.0%'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if (DataType = 'Number', Num( avg( KPI_Value), '#,##0')))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12pt; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #333333;"&gt;&lt;SPAN style="font-family: Arial;"&gt;•&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; The KPI trend shows the last 12 month trend.&amp;nbsp; I am using the below expression.&amp;nbsp; I want to display to display whatever the existing values for the 12 months without averaging. However, the set analysis expression is asking for a aggregation (sum/&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;avg&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; etc.)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; color: #333333;"&gt;&lt;SPAN style="font-family: Arial;"&gt;•&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;avg&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;({1 &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;PeriodKey_End&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt; = {"$(='&amp;gt;' &amp;amp; Date(&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;AddYears&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;(Max(&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;PeriodKey_End&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;), -1), 'YYYY-MM-DD') &amp;amp; '&amp;lt;=' &amp;amp; Date(Max(&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;PeriodKey_End&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;), 'YYYY-MM-DD'))"}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri;"&gt;KPI_Value&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Calibri;"&gt;) &lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I ma attaching the sample qvw file. Please can you help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thank you.&lt;/SPAN&gt;&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/Need-help-with-calculations/m-p/1267996#M853284</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-calculations/m-p/1267997#M853285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Excuse me, but I do not like your data structure. Poor, when the synthetic key connects more than one field of the two tables. In your example (according to the attached file) into a key part of 8 fields. I think it is necessary to start with the creation of the right related to the structure of tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Andrey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Feb 2017 16:26:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-calculations/m-p/1267997#M853285</guid>
      <dc:creator>ahaahaaha</dc:creator>
      <dc:date>2017-02-26T16:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with calculations</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-calculations/m-p/1267998#M853286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this if MeasureDomain is the only selection you want to allow for your this dimension:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Avg({1&amp;lt;PeriodKey_End = {"$(='&amp;gt;' &amp;amp; Date(AddYears(Max(PeriodKey_End), -1), 'YYYY-MM-DD') &amp;amp; '&amp;lt;=' &amp;amp; Date(Max(PeriodKey_End), 'YYYY-MM-DD'))"}&lt;SPAN style="color: #ff0000;"&gt;, MeasureDomain = p(MeasureDomain)&lt;/SPAN&gt;&amp;gt;} KPI_Value)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Avg({&lt;SPAN style="color: #ff0000;"&gt;$&lt;/SPAN&gt;&amp;lt;PeriodKey_End = {"$(='&amp;gt;' &amp;amp; Date(AddYears(Max(PeriodKey_End), -1), 'YYYY-MM-DD') &amp;amp; '&amp;lt;=' &amp;amp; Date(Max(PeriodKey_End), 'YYYY-MM-DD'))"}&amp;gt;} KPI_Value)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/154498_Capture.PNG" style="height: 214px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically when you use 1, you are telling your TREND expression to ignore selections in all the fields. If you want to allow selection in one field (Measure Domain), then you specify it using p() function. If you want to allow for all selections, you need to remove 1 and use $ instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read more about set analysis here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-4951"&gt;Set Analysis: syntaxes, examples&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Feb 2017 18:55:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-calculations/m-p/1267998#M853286</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-26T18:55:49Z</dc:date>
    </item>
  </channel>
</rss>

