<?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 Counting Order Values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Counting-Order-Values/m-p/324559#M497944</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;in above example, is there a difference between variables TotalOrderValue and OrderTotalValue? You use both in your expression (or is it just a typo in your posting?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where do you use these expressions? In a table / chart&amp;nbsp; with dimensions or as a expresion in a textbox?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it would be best if you could upload a small example file, if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Oct 2011 15:29:01 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2011-10-10T15:29:01Z</dc:date>
    <item>
      <title>Counting Order Values</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-Order-Values/m-p/324558#M497943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know I am missing something simple here but I just can't see what it is....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to analyse the invoice and order values that we process to identify where we should set our minimum order value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do this I have created the variable OrderTotalValue aggr(SUM(SALE),ORD)&amp;nbsp; &lt;/P&gt;&lt;P&gt;SALE is the value of the order line and ORD is the order number itself.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This variable gives me positive results elsewhere so I am trusing that it works (my first mistake?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I ask it to split the order values as &amp;lt;=£1000 and &amp;gt;£1000 they do not add up to the total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;lt;=£1000: =SUM(IF(INVOICEDATE&amp;gt;='FromDate' and INVOICEDATE&amp;lt;='ToDate' and $(OrderTotalValue)&amp;lt;=1000,$(TotalOrderValue))) : £4,087,803&lt;/P&gt;&lt;P&gt;&amp;gt;£1000: =SUM(IF(INVOICEDATE&amp;gt;='FromDate' and INVOICEDATE&amp;lt;='ToDate' and $(OrderTotalValue)&amp;gt;1000,$(TotalOrderValue))) : £1,482,852&lt;/P&gt;&lt;P&gt;But the total of all sales between FromDate and ToDate is £6,323,919&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the count function seems to work:&lt;/P&gt;&lt;P&gt;&amp;lt;=£1000: =COUNT(DISTINCT(IF(INVOICEDATE&amp;gt;='FromDate' and INVOICEDATE&amp;lt;='ToDate' and $(OrderTotalValue)&amp;lt;=1000,ORD)) : 17665&lt;/P&gt;&lt;P&gt;&amp;gt;£1000: =COUNT(DISTINCT(IF(INVOICEDATE&amp;gt;='FromDate' and INVOICEDATE&amp;lt;='ToDate' and $(OrderTotalValue)&amp;gt;1000,ORD)) : 1555&lt;/P&gt;&lt;P&gt;Total Number of orders between FromDate and ToDate is 19220&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you see where I am going wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any assistance is greatfully received&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #5a005a; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2011 11:58:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-Order-Values/m-p/324558#M497943</guid>
      <dc:creator>soton34</dc:creator>
      <dc:date>2011-10-10T11:58:23Z</dc:date>
    </item>
    <item>
      <title>Counting Order Values</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-Order-Values/m-p/324559#M497944</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;in above example, is there a difference between variables TotalOrderValue and OrderTotalValue? You use both in your expression (or is it just a typo in your posting?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where do you use these expressions? In a table / chart&amp;nbsp; with dimensions or as a expresion in a textbox?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it would be best if you could upload a small example file, if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2011 15:29:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-Order-Values/m-p/324559#M497944</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-10-10T15:29:01Z</dc:date>
    </item>
    <item>
      <title>Counting Order Values</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-Order-Values/m-p/324560#M497945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are correct.&amp;nbsp; A slight typo.&amp;nbsp; They should all be OrderTotalValue (it is correct in my variables and expressions)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to build a chart/table showing the value of orders within a range and the % of total company sales.&amp;nbsp; This would help to identify where we are 'wasting' effort on small value orders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I started with a simple distinction of &amp;gt; or &amp;lt; £1000 to test the theory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ultimately I could use distinct textboxes to demonstrate the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sorry but I wouldn't know where to start with uploading a sample.&amp;nbsp; Have I supplied sufficient information for a result?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2011 15:46:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-Order-Values/m-p/324560#M497945</guid>
      <dc:creator>soton34</dc:creator>
      <dc:date>2011-10-10T15:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Order Values</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-Order-Values/m-p/324561#M497946</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;you could upload a sample in advanced editor (follow the link on upper right of your editor window) or by editing an existing post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a small one as example, please check if this comes close to your problem, we could then use mine to discuss your problem, if you want (or upload a corrected one).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried implementing you variable and compared the partial sums (for &amp;lt; 100 and &amp;gt; 100) with the total sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example, I don't see a difference, so I think my example is not exactely like your setting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2011 16:40:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-Order-Values/m-p/324561#M497946</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-10-10T16:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Order Values</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-Order-Values/m-p/324562#M497947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Stefan - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your advice has inadvertantly helped me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to create a small QV document with a limited amount of the data to supply to you as a sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This highlighted that there was an area of the load script that was incorrect and was not including all of the ORD numbers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I had amended the script the problem has gone away.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your persistent assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 13:58:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-Order-Values/m-p/324562#M497947</guid>
      <dc:creator>soton34</dc:creator>
      <dc:date>2011-10-11T13:58:48Z</dc:date>
    </item>
  </channel>
</rss>

