<?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 Set Analysis to Select/Filter by Values in Data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-to-Select-Filter-by-Values-in-Data/m-p/317890#M497243</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just thought I would share something I did for a document I've been working on. I have a 'page' in the document that displays 12 graphs (bar charts) for different types of travel records (air, car, hotel, rail) and within each of those categories I have a graph that displays 'total paid', 'sum of records' and 'avg cost'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I had was that my data for air and rail is mixed together and only differentiated by a travel mode (A or R). I had to use Set Analysis to properly sum the total cost and number of records for air:&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;[Mode]={'R'}&amp;gt;}[Cost])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used a similar expression for number of records. Then I encountered a problem where the avg cost per record was being divided (the cost for Rail) by all records (not just Rail). I eventually got it to work with the following expression:&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;[Mode]={'R'}&amp;gt;}[Cost]) / SUM({$&amp;lt;[Mode]={'R'}&amp;gt;}[Record])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Nov 2011 15:24:12 GMT</pubDate>
    <dc:creator>jcampbell</dc:creator>
    <dc:date>2011-11-14T15:24:12Z</dc:date>
    <item>
      <title>Set Analysis to Select/Filter by Values in Data</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-to-Select-Filter-by-Values-in-Data/m-p/317890#M497243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just thought I would share something I did for a document I've been working on. I have a 'page' in the document that displays 12 graphs (bar charts) for different types of travel records (air, car, hotel, rail) and within each of those categories I have a graph that displays 'total paid', 'sum of records' and 'avg cost'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I had was that my data for air and rail is mixed together and only differentiated by a travel mode (A or R). I had to use Set Analysis to properly sum the total cost and number of records for air:&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;[Mode]={'R'}&amp;gt;}[Cost])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used a similar expression for number of records. Then I encountered a problem where the avg cost per record was being divided (the cost for Rail) by all records (not just Rail). I eventually got it to work with the following expression:&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;[Mode]={'R'}&amp;gt;}[Cost]) / SUM({$&amp;lt;[Mode]={'R'}&amp;gt;}[Record])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 15:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-to-Select-Filter-by-Values-in-Data/m-p/317890#M497243</guid>
      <dc:creator>jcampbell</dc:creator>
      <dc:date>2011-11-14T15:24:12Z</dc:date>
    </item>
  </channel>
</rss>

