<?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 Nested set analysis? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062862#M466378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;I want to do some analysis that counts the number of items sold to customers with a total spend between certain spend thresholds. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;E.g. Customers spending between 0-999 bought a total of 500 boxes of product A, 399 boxes of product B. Customers spending between 1000-1499 bought 300 boxes of product B etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;My understanding is that I need to do a set analysis expression for each threshold spend whilst using product as the dimension. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;I've got as far as writing an expression that looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;location_id&lt;/SPAN&gt;=&lt;SPAN style="color: #0000ff;"&gt;P&lt;/SPAN&gt;({&amp;lt;&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;threshold_value&lt;/SPAN&gt;)={&lt;SPAN style="color: #800000;"&gt;"&amp;gt;0&amp;lt;1000"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 14pt;"&gt;}&amp;gt;})threshold_quantity) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;I've done something wrong here but I'm not sure what! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;With your help what I'm hoping to produce is a simple table that shows all of our hundreds of products and a count of units sold by the various thresholds.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Thanks for your help &lt;/SPAN&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Feb 2016 16:12:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-02-05T16:12:23Z</dc:date>
    <item>
      <title>Nested set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062862#M466378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;I want to do some analysis that counts the number of items sold to customers with a total spend between certain spend thresholds. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;E.g. Customers spending between 0-999 bought a total of 500 boxes of product A, 399 boxes of product B. Customers spending between 1000-1499 bought 300 boxes of product B etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;My understanding is that I need to do a set analysis expression for each threshold spend whilst using product as the dimension. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;I've got as far as writing an expression that looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;location_id&lt;/SPAN&gt;=&lt;SPAN style="color: #0000ff;"&gt;P&lt;/SPAN&gt;({&amp;lt;&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;threshold_value&lt;/SPAN&gt;)={&lt;SPAN style="color: #800000;"&gt;"&amp;gt;0&amp;lt;1000"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 14pt;"&gt;}&amp;gt;})threshold_quantity) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;I've done something wrong here but I'm not sure what! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;With your help what I'm hoping to produce is a simple table that shows all of our hundreds of products and a count of units sold by the various thresholds.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Thanks for your help &lt;/SPAN&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 16:12:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062862#M466378</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-05T16:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Nested set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062863#M466379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if I understand, could you maybe upload a small sample QVW?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking about something like this (in a chart with dimension Product):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count( {&amp;lt;Customer = {"=Sum(SpentValue) &amp;gt;= 0 and Sum(SpentValue) &amp;lt;1000"} &amp;gt;} DISTINCT BoxID)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 19:00:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062863#M466379</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-05T19:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Nested set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062864#M466380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;({$&amp;lt;&lt;SPAN style="color: #800000;"&gt;location_id&lt;/SPAN&gt;=&lt;SPAN style="color: #0000ff;"&gt;P&lt;/SPAN&gt;({&amp;lt;&lt;SPAN style="color: #0000ff;"&gt;sum&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;threshold_value&lt;/SPAN&gt;)={&lt;SPAN style="color: #800000;"&gt;"&amp;gt;0&amp;lt;1000"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 14pt;"&gt;}&amp;gt;})threshold_quantity) &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;I've done something wrong here but I'm not sure what! &lt;SPAN class="emoticon-inline emoticon_confused" style="width: 16px; height: 16px;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To me this looked like an implicit question, so I'll try to answer it.&lt;/P&gt;&lt;P&gt;Set modifiers (everything you put between &amp;lt; and &amp;gt; in a - in your case "nested" - set specification) change the data set for an expression by temporarily assigning other values to one or more listed fields. As a consequence, the equal sign in the middle is an assignment operator, not a comparison operator.&lt;/P&gt;&lt;P&gt;A second consequence of this statement is that the left hand side of the assignment operator should always be a field name. You cannot assign values larger than 0 and smaller than 1000 to &lt;EM&gt;the sum of all threshold_value values&lt;/EM&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 20:57:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062864#M466380</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-02-05T20:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Nested set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062865#M466381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply. I haven't got a small enough QVW to upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The objective I'm trying to reach is a table that would have products listed down the left and columns that show each product's volumes by spend grouping. I wouldn't want to include the product itself within the expression as it's the dimension. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In plain english this is what I want to get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How many boxes/units of each product we sell is purchased by customers spending between a and b, b and c, d and e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is nothing in our data that currently groups customers by spend and so it would need to be done in the set analysis (unless there's another way?). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 14:12:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062865#M466381</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-08T14:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Nested set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062866#M466382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My intention was to do this by creating a field modifier for Customer with an advanced search expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;=Count( {&amp;lt;&lt;STRONG&gt;Customer = {"=Sum(SpentValue) &amp;gt;= 0 and Sum(SpentValue) &amp;lt;1000"}&lt;/STRONG&gt; &amp;gt;} DISTINCT BoxID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add more expressions to select customers with different spend amount:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em; background-color: #f2f2f2;"&gt;=Count( {&amp;lt;Customer = {"=Sum(SpentValue) &amp;gt;= 1000 and Sum(SpentValue) &amp;lt;2000"} &amp;gt;} DISTINCT BoxID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 12px; background-color: #f2f2f2; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=Count( {&amp;lt;Customer = {"=Sum(SpentValue) &amp;gt;= 2000 and Sum(SpentValue) &amp;lt;5000"} &amp;gt;} DISTINCT BoxID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also use variables in the expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em; background-color: #f2f2f2;"&gt;=Count( {&amp;lt;Customer = {"=Sum(SpentValue) &amp;gt;= a and Sum(SpentValue) &amp;lt;b"} &amp;gt;} DISTINCT BoxID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 12px; background-color: #f2f2f2; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=Count( {&amp;lt;Customer = {"=Sum(SpentValue) &amp;gt;= b and Sum(SpentValue) &amp;lt;c"} &amp;gt;} DISTINCT BoxID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 12px; background-color: #f2f2f2; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=Count( {&amp;lt;Customer = {"=Sum(SpentValue) &amp;gt;= c and Sum(SpentValue) &amp;lt;d"} &amp;gt;} DISTINCT BoxID)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 16:33:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062866#M466382</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-08T16:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Nested set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062867#M466383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've tried this as an example expression:&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;location_id={"=sum(threshold_value)&amp;gt;1000 and sum(threshold_value)&amp;lt;1500"}&amp;gt;}threshold_quantity)&lt;/P&gt;&lt;P&gt;With the dimension as the SKU code of the products. There is some flaw with this though as when I add a second dimension which is the product description (a text field that describes the product) multiple descriptions are being assigned to each of the SKU codes when it should be 1 code to 1 description. So something can't be quite right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 16:51:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062867#M466383</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-08T16:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Nested set analysis?</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062868#M466384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hard to say without knowing your data model. Could you upload a small sample QVW?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 17:50:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-set-analysis/m-p/1062868#M466384</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-08T17:50:12Z</dc:date>
    </item>
  </channel>
</rss>

