<?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 Re: Aggregation and set analysis. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379042#M420639</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny,&amp;nbsp; the qvd had started creating duplicates and this is what was causing the issue.&amp;nbsp; Above formula still works. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Aug 2017 14:10:30 GMT</pubDate>
    <dc:creator>tom2qlik</dc:creator>
    <dc:date>2017-08-10T14:10:30Z</dc:date>
    <item>
      <title>Aggregation and set analysis.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379036#M420633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to replicate a chart total in another chart as an expression.&amp;nbsp; The value I was trying to create was the TOTAL of my cost expression as shown below.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/173042_pastedImage_4.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;To do this I simply aggregated the expression by Date, L and ID which provided the correct value of £5697.85.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MONEY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DataSource&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'Waste'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Last7Days&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={1}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WeekDay&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'SUN'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Cost&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;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DataSource&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'Waste'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Last7Days&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={1}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WeekDay&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'SUN'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ActualWeight&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;L, ID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)), '£#,##0') &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I completed this expression in a textbox which worked however when I put it into the new chart which was using a value list the expression no longer worked and return a value of £0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After a bit of research I found that aggregation within a value list doesn't seem to work as one would expect therefore I devised a new solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MONEY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DataSource&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'Waste'}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Last7Days&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={1}, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WeekDay&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'SUN'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Cost&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;*&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ActualWeight&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), '£#,##0')&lt;BR /&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;New solution worked within the value list chart and I believed the outcome had be achieved and moved on.&amp;nbsp; Next day I rebuild my app and low and behold the working value within the chart has changed from the correct value of £5697.85 to £11396 &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have checked the data and done the calculation manually and it should still equal £5697.85.&amp;nbsp; No data for that day has changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain what I've missed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate any advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 09:53:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379036#M420633</guid>
      <dc:creator>tom2qlik</dc:creator>
      <dc:date>2017-08-10T09:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation and set analysis.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379037#M420634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess, it would be something related to date comparison. Your date flags like &lt;EM&gt;Last7Days &lt;/EM&gt;changes on every different day reload, if you reload today, &lt;EM&gt;Last7Days &lt;/EM&gt;flag may get 10,9, 8,7,6,5,4 days of Aug, while if you reload it tomorrow, the flag would mark 11,10..6,5 days of Aug and eventually your expression gives different result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 10:12:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379037#M420634</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-08-10T10:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation and set analysis.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379038#M420635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your input. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you're right, each day the it rebuilds the days with the flag change.&amp;nbsp; So &lt;EM&gt;Weekday&lt;/EM&gt; 'SUN' is the 6th of Aug and will have a value of 1 for &lt;EM&gt;Last7Days. &lt;/EM&gt;Eventually yes the value will change to the most recent weekday but for this it in this case it has not changed yet. Therefore I can't see why the value would change when the data for that set analysis stays the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 10:35:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379038#M420635</guid>
      <dc:creator>tom2qlik</dc:creator>
      <dc:date>2017-08-10T10:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation and set analysis.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379039#M420636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That would depend on how (the statement you used) you created the flag in the script. Could you post your app sample or the script snippet at least?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 10:42:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379039#M420636</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-08-10T10:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation and set analysis.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379040#M420637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Last7Days flag is created with the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()-&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DateLink&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;gt;=0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;()-&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DateLink&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;lt;7,1,0) &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;Last7Days &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might be difficult to get a sample app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 11:03:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379040#M420637</guid>
      <dc:creator>tom2qlik</dc:creator>
      <dc:date>2017-08-10T11:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation and set analysis.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379041#M420638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It appears that your data seems to be duplicating somewhere... because 5,697.85*2 = 11,395.7.... May be there you need to change your data model a little bit to avoid this duplication?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 11:11:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379041#M420638</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-08-10T11:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation and set analysis.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379042#M420639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny,&amp;nbsp; the qvd had started creating duplicates and this is what was causing the issue.&amp;nbsp; Above formula still works. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 14:10:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-and-set-analysis/m-p/1379042#M420639</guid>
      <dc:creator>tom2qlik</dc:creator>
      <dc:date>2017-08-10T14:10:30Z</dc:date>
    </item>
  </channel>
</rss>

