<?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 First sorted value count by year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/First-sorted-value-count-by-year/m-p/1650079#M447772</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;have updated a seperate thread with regards to the issue i face...&lt;/P&gt;&lt;P&gt;on this complicated aggr function thanks to&amp;nbsp;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628" target="_blank"&gt;@sunny_talwar&lt;/A&gt;&amp;nbsp; i would like to incorporate some set analysis to look at dates also...&lt;/P&gt;&lt;P&gt;so i would like the logic to look for differences between the last 12 months and the previous 12 months to show the variation across the 2 12 month periods..&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;so the same as this but with PurchaseDate &amp;gt;12 months ago as 1 expression to show current 12 months:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Min&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;}&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;total&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;If&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;Only&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;}&lt;/SPAN&gt;PricePaid&lt;SPAN class="s2"&gt;) =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;}&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PricePaid&lt;SPAN class="s2"&gt;, -&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;Sum&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;}&lt;/SPAN&gt;[Quantity]&lt;SPAN class="s2"&gt;),&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PricePaid&lt;SPAN class="s2"&gt;)),&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;Only&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;}&lt;/SPAN&gt;PricePaid&lt;SPAN class="s2"&gt;)),&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PricePaid&lt;SPAN class="s2"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and the same logic then showing the previous 12 months before that. as you can see from the application as attached, if i select purchase dates from Dec-18 (dynamic 12 months back from the Max date per customer) to Nov-19.&lt;/P&gt;&lt;P&gt;for customer 3 this shows as 55.561 as most frequent pricepaid by sum quantity from dec-18 through Nov-19&lt;/P&gt;&lt;P&gt;same customer shows 528 as most frequent price paid by sum of quantity from Jan-18 through Nov-18.&lt;/P&gt;&lt;P&gt;so using the above logic to find price paid in last 12 months vs the same figure the 12 months previous&lt;/P&gt;&lt;P&gt;any help would be great thank you and hope this makes sense&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 19:36:38 GMT</pubDate>
    <dc:creator>LeeSmithBtn</dc:creator>
    <dc:date>2024-11-16T19:36:38Z</dc:date>
    <item>
      <title>First sorted value count by year</title>
      <link>https://community.qlik.com/t5/QlikView/First-sorted-value-count-by-year/m-p/1650079#M447772</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;have updated a seperate thread with regards to the issue i face...&lt;/P&gt;&lt;P&gt;on this complicated aggr function thanks to&amp;nbsp;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628" target="_blank"&gt;@sunny_talwar&lt;/A&gt;&amp;nbsp; i would like to incorporate some set analysis to look at dates also...&lt;/P&gt;&lt;P&gt;so i would like the logic to look for differences between the last 12 months and the previous 12 months to show the variation across the 2 12 month periods..&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;so the same as this but with PurchaseDate &amp;gt;12 months ago as 1 expression to show current 12 months:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Min&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;}&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;total&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;If&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;Only&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;}&lt;/SPAN&gt;PricePaid&lt;SPAN class="s2"&gt;) =&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;}&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PricePaid&lt;SPAN class="s2"&gt;, -&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;Sum&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;}&lt;/SPAN&gt;[Quantity]&lt;SPAN class="s2"&gt;),&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PricePaid&lt;SPAN class="s2"&gt;)),&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;Only&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;({&amp;lt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;&amp;gt;}&lt;/SPAN&gt;PricePaid&lt;SPAN class="s2"&gt;)),&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;Customer&lt;SPAN class="s2"&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;PricePaid&lt;SPAN class="s2"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and the same logic then showing the previous 12 months before that. as you can see from the application as attached, if i select purchase dates from Dec-18 (dynamic 12 months back from the Max date per customer) to Nov-19.&lt;/P&gt;&lt;P&gt;for customer 3 this shows as 55.561 as most frequent pricepaid by sum quantity from dec-18 through Nov-19&lt;/P&gt;&lt;P&gt;same customer shows 528 as most frequent price paid by sum of quantity from Jan-18 through Nov-18.&lt;/P&gt;&lt;P&gt;so using the above logic to find price paid in last 12 months vs the same figure the 12 months previous&lt;/P&gt;&lt;P&gt;any help would be great thank you and hope this makes sense&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:36:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-sorted-value-count-by-year/m-p/1650079#M447772</guid>
      <dc:creator>LeeSmithBtn</dc:creator>
      <dc:date>2024-11-16T19:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: First sorted value count by year</title>
      <link>https://community.qlik.com/t5/QlikView/First-sorted-value-count-by-year/m-p/1650085#M447774</link>
      <description>&lt;P&gt;Would you be able to create the MonthYear field like this in the script and reload and reattach it here&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Date(MonthStart(TempDate), 'MMM-YYYY') 				as MonthYear,&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 22 Nov 2019 12:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-sorted-value-count-by-year/m-p/1650085#M447774</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-11-22T12:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: First sorted value count by year</title>
      <link>https://community.qlik.com/t5/QlikView/First-sorted-value-count-by-year/m-p/1650104#M447777</link>
      <description>&lt;P&gt;Hi Sunny,&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should have a field like this already in the app (unless i have published the wrong app)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 13:05:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-sorted-value-count-by-year/m-p/1650104#M447777</guid>
      <dc:creator>LeeSmithBtn</dc:creator>
      <dc:date>2019-11-22T13:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: First sorted value count by year</title>
      <link>https://community.qlik.com/t5/QlikView/First-sorted-value-count-by-year/m-p/1650106#M447778</link>
      <description>&lt;P&gt;My Bad, i see what you mean... here is updated... you should be ok reloading the app as its all in the script, no external files required&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you as always&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 13:07:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-sorted-value-count-by-year/m-p/1650106#M447778</guid>
      <dc:creator>LeeSmithBtn</dc:creator>
      <dc:date>2019-11-22T13:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: First sorted value count by year</title>
      <link>https://community.qlik.com/t5/QlikView/First-sorted-value-count-by-year/m-p/1650151#M447780</link>
      <description>&lt;P&gt;Sorry about that, I didn't realize it was an Inline Load... try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Min({&amp;lt;MonthYear = {"&amp;gt;=$(=Date(MonthStart(Min(MonthYear), -12), 'MMM-YYYY'))&amp;lt;=$(=Date(MonthStart(Max(MonthYear), -12), 'MMM-YYYY'))"}&amp;gt;} TOTAL &amp;lt;Customer&amp;gt; Aggr(
	If(Only({&amp;lt;Customer, MonthYear = {"&amp;gt;=$(=Date(MonthStart(Min(MonthYear), -12), 'MMM-YYYY'))&amp;lt;=$(=Date(MonthStart(Max(MonthYear), -12), 'MMM-YYYY'))"}&amp;gt;} PricePaid) = FirstSortedValue({&amp;lt;Customer, MonthYear = {"&amp;gt;=$(=Date(MonthStart(Min(MonthYear), -12), 'MMM-YYYY'))&amp;lt;=$(=Date(MonthStart(Max(MonthYear), -12), 'MMM-YYYY'))"}&amp;gt;} TOTAL &amp;lt;Customer&amp;gt; PricePaid, -Aggr(Sum({&amp;lt;Customer, MonthYear = {"&amp;gt;=$(=Date(MonthStart(Min(MonthYear), -12), 'MMM-YYYY'))&amp;lt;=$(=Date(MonthStart(Max(MonthYear), -12), 'MMM-YYYY'))"}&amp;gt;}[Quantity]), Customer, PricePaid)), Only({&amp;lt;Customer, MonthYear = {"&amp;gt;=$(=Date(MonthStart(Min(MonthYear), -12), 'MMM-YYYY'))&amp;lt;=$(=Date(MonthStart(Max(MonthYear), -12), 'MMM-YYYY'))"}&amp;gt;}PricePaid))
, Customer, PricePaid))&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 22 Nov 2019 14:17:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/First-sorted-value-count-by-year/m-p/1650151#M447780</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-11-22T14:17:04Z</dc:date>
    </item>
  </channel>
</rss>

