<?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: Summing Firstsortedvalue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776580#M717943</link>
    <description>&lt;P&gt;In that case, you probably have to remove set analysis section and use aggr() instead. Try to prepare a sample app and explain the expected output in that context, that would help us understand the issue better and propose a feasible solution.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jan 2021 05:22:04 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2021-01-22T05:22:04Z</dc:date>
    <item>
      <title>Summing Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1775814#M717932</link>
      <description>&lt;P&gt;I am using the below expression to determine the top selling item in a straight table.&lt;/P&gt;&lt;P&gt;FirstSortedValue([Short Name],-[Sales_Value],1)&lt;/P&gt;&lt;P&gt;This works fine for individual sales weeks.&amp;nbsp; However, when multiple weeks or the entire sales year is selected, the result that is given is just the highest sales value for an individual week .&lt;/P&gt;&lt;P&gt;Is it possible for a number of weeks to be summed (e.g. sales for weeks 20 to 25) and then the total of these weeks to be sorted by highest selling value?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If possible I would also like the weeks / year to be dynamic and not hard coded with set analysis.&lt;/P&gt;&lt;P&gt;Thanks for your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 00:17:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1775814#M717932</guid>
      <dc:creator>NickBentley</dc:creator>
      <dc:date>2021-01-20T00:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Summing Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776084#M717933</link>
      <description>&lt;P&gt;can you attach your QVW?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 19:46:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776084#M717933</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-01-20T19:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Summing Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776121#M717934</link>
      <description>&lt;P&gt;Hi Edwin,&lt;/P&gt;&lt;P&gt;My QVW contains sensitive data so I am unable to share.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been able to use the following expression to successfully get sales value to accumulate over dynamic weeks and then show the highest individual accumulation (max figure):&lt;/P&gt;&lt;P&gt;max(Aggr(Sum(Sales_Value),[Item Name],Store Name))&lt;/P&gt;&lt;P&gt;I have also used the next expression (below) to succesfully show the item name of the highest accumulated figure:&lt;/P&gt;&lt;P&gt;=FirstSortedValue([Item Name], -Aggr(Sum(Sales_Value), [Item Name]),1)&lt;/P&gt;&lt;P&gt;However, my challenge now is to get the sum of the associated units sold (Qty) to that item over the same period, this is something I can't seem to work out as the units need to also accumulate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 21:57:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776121#M717934</guid>
      <dc:creator>NickBentley</dc:creator>
      <dc:date>2021-01-20T21:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Summing Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776167#M717935</link>
      <description>&lt;P&gt;I believe the solution I am now after is to find the 'Firstsortedvalue' of the results of a previous 'Firstsortedvalue'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Firstsortedvalue to find the item with the highest value sales amount, and now I need to find the quantity (units) associated with that sales amount. If I run firstsortedvalue on units alone it gives the item with highest units sales which is not often the same as the item with the highest value sales amount.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 06:04:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776167#M717935</guid>
      <dc:creator>NickBentley</dc:creator>
      <dc:date>2021-01-21T06:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Summing Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776169#M717937</link>
      <description>&lt;P&gt;Give a try like:&lt;/P&gt;&lt;P&gt;Sum(&lt;/P&gt;&lt;P&gt;{&amp;lt;[Item Name]={'&lt;STRONG&gt;$(=&lt;/STRONG&gt;&lt;SPAN&gt;FirstSortedValue([Item Name], -Aggr(Sum(Sales_Value), [Item Name]),1)&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;'}&amp;gt;}&lt;/P&gt;&lt;P&gt;Units)&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 06:13:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776169#M717937</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2021-01-21T06:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Summing Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776173#M717938</link>
      <description>&lt;P&gt;Tresesco&lt;/P&gt;&lt;P&gt;Thank you for your solution, works a treat!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 06:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776173#M717938</guid>
      <dc:creator>NickBentley</dc:creator>
      <dc:date>2021-01-21T06:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Summing Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776526#M717941</link>
      <description>&lt;P&gt;Hi Tresesco,&lt;/P&gt;&lt;P&gt;Using the expression above I am changing the '1' to a '2' hoping to get the unit quantity for the second ranked item (in terms of sales value) - for some reason this is not getting the anticipated results?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 23:59:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776526#M717941</guid>
      <dc:creator>NickBentley</dc:creator>
      <dc:date>2021-01-21T23:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Summing Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776533#M717942</link>
      <description>&lt;P&gt;The expression works as expected when only one 'Store Name' is selected but gives incorrect results when all/multiple stores are selected. I beleive I have to lock the store name into the expression some how but not sure on how to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 00:56:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776533#M717942</guid>
      <dc:creator>NickBentley</dc:creator>
      <dc:date>2021-01-22T00:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Summing Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776580#M717943</link>
      <description>&lt;P&gt;In that case, you probably have to remove set analysis section and use aggr() instead. Try to prepare a sample app and explain the expected output in that context, that would help us understand the issue better and propose a feasible solution.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 05:22:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776580#M717943</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2021-01-22T05:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Summing Firstsortedvalue</title>
      <link>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776598#M717944</link>
      <description>&lt;P&gt;Thanks for your reply Tresesco.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to created a straight table with the dimension as Store Name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expression 1 : Total Sales&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expression 2:&amp;nbsp; #1 Selling Item (Name)&lt;/P&gt;&lt;P&gt;Expression 3:&amp;nbsp;&amp;nbsp;#1 Selling Item (Sales Value)&lt;/P&gt;&lt;P&gt;Expression 4: Units sold of&amp;nbsp; #1 Selling Item (Units Sold)&lt;/P&gt;&lt;P&gt;Expression 5:&amp;nbsp; #2 Selling Item (Name)&lt;/P&gt;&lt;P&gt;Expression 6:&amp;nbsp;&amp;nbsp;#2 Selling Item (Sales Value)&lt;/P&gt;&lt;P&gt;Expression 7: Units sold of&amp;nbsp; #2 Selling Item (Units Sold)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far the #1 Selling Item Name and #1 Selling Item Sales Value is working correctly.&amp;nbsp; The issue is the units sold is not adding up correctly.&lt;/P&gt;&lt;P&gt;I am after an expression for each store that identifies the top selling item by value and the number of units sold for that item.&amp;nbsp; I would also like to select individual weeks as well as a series of weeks (i.e. weeks 1 - 3) at certain times.&amp;nbsp;&lt;/P&gt;&lt;P&gt;All suggestions are greatly appreciated&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 06:23:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Summing-Firstsortedvalue/m-p/1776598#M717944</guid>
      <dc:creator>NickBentley82</dc:creator>
      <dc:date>2021-01-22T06:23:43Z</dc:date>
    </item>
  </channel>
</rss>

