<?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: How to generate a Whale Curve and Cumulative Profit graph from unsorted raw sales data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-generate-a-Whale-Curve-and-Cumulative-Profit-graph-from/m-p/763454#M535046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi William.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish my new book &lt;STRONG&gt;&lt;EM&gt;QlikView Your Business&lt;/EM&gt;&lt;/STRONG&gt; was already out!!! It's coming out in April. In the book, I am giving very detailed step-by-step instructions on building the Whale Tail chart. You'll get to build one as part of the tutorial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming that you don't want to wait till April to buy the book, let me give you some abbreviated instructions here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chart Type: Scatter Chart.&lt;/P&gt;&lt;P&gt;Dimension: Customer&lt;/P&gt;&lt;P&gt;X-Axis Expression: Cumulative Sales =&amp;nbsp; Sum(Sales), using Full Accumulation.&lt;/P&gt;&lt;P&gt;Y-Axis Expression: Cumulative Profit Amount = sum(Profit), using Full Accumulation&lt;/P&gt;&lt;P&gt;Sorting Expression: Profit Margin Percent, &lt;SPAN style="text-decoration: underline;"&gt;Descending&lt;/SPAN&gt; = sum(Profit)/Sum(Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to enhance the chart, you can add four Reference Lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Actual Total Sales&lt;/P&gt;&lt;P&gt;2. Sales for the products with positive Profit margins (Sales to reach maximum profit)&lt;/P&gt;&lt;P&gt;3. Actual Profit&lt;/P&gt;&lt;P&gt;4. Maximum possible Profit (sum of all the positive profits)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These calculations are a bit tricky, and I'll leave these extra details for you to discover in the book. Check it out, it's already listed on Amazon with a discounted pre-order price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;www.masterssummit.com - take your QlikView skills to the next level!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Feb 2015 18:41:49 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2015-02-09T18:41:49Z</dc:date>
    <item>
      <title>How to generate a Whale Curve and Cumulative Profit graph from unsorted raw sales data</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-generate-a-Whale-Curve-and-Cumulative-Profit-graph-from/m-p/763453#M535045</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 a set of data whereby&amp;nbsp; I need to generate 2 types of graphs - a whale curve and a cumulative graph.&lt;/P&gt;&lt;P&gt;This is the raw data I have which consists of Customer , Sales and Profit. Assume data is &lt;STRONG&gt;unsorted&lt;/STRONG&gt;, so this means I need to use the rank function on some expression later on...&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/77356_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;These are the 2 graphs which is what I eventually need as an output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/77358_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;X-axis = Cumulative Sales, Y-axis = Cumulative Profit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/77359_pastedImage_3.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;X-axis = Customers (sorted according to profitability), Y-axis = Cumulative Profit&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone pls share what should I be using for the Dimensions, Expressions and Sort values for each graph?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the 1st whale curve, I checked out Barry's helpful blog (&lt;A href="http://www.qlikfix.com/2010/11/10/visualizing-customer-profitability-with-a-whale-curve/" title="http://www.qlikfix.com/2010/11/10/visualizing-customer-profitability-with-a-whale-curve/"&gt;Visualizing customer profitability with a whale curve - The Qlik Fix! The Qlik Fix!&lt;/A&gt;) for reference but I'm not getting the graph I expected &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension: aggr(num(rank(sum(Sales),4)),Customer)&lt;/P&gt;&lt;P&gt;Expression: rangesum(above(total ROUND(sum( Profit)),0,RowNo(TOTAL)))&lt;/P&gt;&lt;P&gt;Sort: which maps default to dimension (&lt;SPAN style="font-size: 13.3333330154419px;"&gt;aggr(num(rank(sum(Sales),4)),Customer)&lt;/SPAN&gt;), that I set as "Ascending".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, how do I return a corresponding field e.g. "John", "Richard", etc... for the X-axis?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Feb 2015 07:33:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-generate-a-Whale-Curve-and-Cumulative-Profit-graph-from/m-p/763453#M535045</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-07T07:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a Whale Curve and Cumulative Profit graph from unsorted raw sales data</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-generate-a-Whale-Curve-and-Cumulative-Profit-graph-from/m-p/763454#M535046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi William.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish my new book &lt;STRONG&gt;&lt;EM&gt;QlikView Your Business&lt;/EM&gt;&lt;/STRONG&gt; was already out!!! It's coming out in April. In the book, I am giving very detailed step-by-step instructions on building the Whale Tail chart. You'll get to build one as part of the tutorial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming that you don't want to wait till April to buy the book, let me give you some abbreviated instructions here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chart Type: Scatter Chart.&lt;/P&gt;&lt;P&gt;Dimension: Customer&lt;/P&gt;&lt;P&gt;X-Axis Expression: Cumulative Sales =&amp;nbsp; Sum(Sales), using Full Accumulation.&lt;/P&gt;&lt;P&gt;Y-Axis Expression: Cumulative Profit Amount = sum(Profit), using Full Accumulation&lt;/P&gt;&lt;P&gt;Sorting Expression: Profit Margin Percent, &lt;SPAN style="text-decoration: underline;"&gt;Descending&lt;/SPAN&gt; = sum(Profit)/Sum(Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to enhance the chart, you can add four Reference Lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Actual Total Sales&lt;/P&gt;&lt;P&gt;2. Sales for the products with positive Profit margins (Sales to reach maximum profit)&lt;/P&gt;&lt;P&gt;3. Actual Profit&lt;/P&gt;&lt;P&gt;4. Maximum possible Profit (sum of all the positive profits)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These calculations are a bit tricky, and I'll leave these extra details for you to discover in the book. Check it out, it's already listed on Amazon with a discounted pre-order price.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;&lt;P&gt;www.masterssummit.com - take your QlikView skills to the next level!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 18:41:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-generate-a-Whale-Curve-and-Cumulative-Profit-graph-from/m-p/763454#M535046</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2015-02-09T18:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a Whale Curve and Cumulative Profit graph from unsorted raw sales data</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-generate-a-Whale-Curve-and-Cumulative-Profit-graph-from/m-p/763455#M535047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for getting back to me on this! And I sure wished I had a copy of ur new book &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, I've managed to solve it using rangesum as an alternative to using full accumulation.&lt;/P&gt;&lt;P&gt;To elaborate on my earlier scenario which I didn't show in my example above, I had a Customer-ID field as a unique key and I use "Customer" as a field name above to designate customer names&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Graph 1:&lt;/P&gt;&lt;P&gt;Y-Axis:&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Rangesum(above(total ROUND(sum(Profit)),0,RowNo(TOTAL)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;X-Axis: aggr(Rangesum(above(total ROUND(sum(Sales)),0,RowNo(TOTAL))),Customer-ID)&lt;/P&gt;&lt;P&gt;Sort: Rangesum(above(total ROUND(sum(Sales)),0,RowNo(TOTAL)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Graph 2:&lt;/P&gt;&lt;P&gt;Y-Axis Expression: Rangesum(above(total ROUND(sum(Profit)),0,RowNo(TOTAL)))&lt;/P&gt;&lt;P&gt;X-Axis: Customer&lt;/P&gt;&lt;P&gt;Sort: aggr(num(rank(sum(Profit),4)),Entity_Cust), Ascending&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally speaking, this met my requirement .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also play around with your instructions above to see any new graphs I can plot!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 01:43:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-generate-a-Whale-Curve-and-Cumulative-Profit-graph-from/m-p/763455#M535047</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-10T01:43:50Z</dc:date>
    </item>
  </channel>
</rss>

