<?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 How to do this query? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-do-this-query/m-p/144294#M505782</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT customer_id, customer_name, Count(campaign_id) As campaign_count&lt;/P&gt;&lt;P&gt;FROM customer, participation&lt;/P&gt;&lt;P&gt;WHERE customer.customer_id = participation.customer_id&lt;/P&gt;&lt;P&gt;GROUP BY customer_id, customer_name&lt;/P&gt;&lt;P&gt;You could use that in place of loading the Customer table by itself. You would still probably want to load the Campaign and Participation tables as are. Then in your expressions, use Set Analysis to get the counts.&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;campaign_count = {1}&amp;gt;}, 1, 0) would be the number that participated in 1 campaign.&lt;/P&gt;&lt;P&gt;The above query is Oracle SQL, here's T-SQL is you prefer:&lt;/P&gt;&lt;P&gt;SELECT customer_id, customer_name, Count(campaign_id) As campaign_count&lt;/P&gt;&lt;P&gt;FROM customer INNER JOIN participation ON customer.customer_id = participation.customer_id&lt;/P&gt;&lt;P&gt;GROUP BY customer_id, customer_name&lt;/P&gt;&lt;P&gt;I'd also expect that this could be done by simply loading your tables individually and then using expressions to do all the dirty work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 May 2009 02:33:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-05-16T02:33:30Z</dc:date>
    <item>
      <title>How to do this query?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-do-this-query/m-p/144293#M505781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have the follow situation:&lt;/P&gt;&lt;P&gt;table: CUSTOMER&lt;BR /&gt;customer_id | customer_name&lt;/P&gt;&lt;P&gt;table: CAMPAING&lt;BR /&gt;campaing_id | campaing_name&lt;BR /&gt;&lt;BR /&gt;table: PARTICIPATION&lt;BR /&gt;campaing_id | customer_id&lt;/P&gt;&lt;P&gt;Many customers can participate of many campaing, righ?&lt;/P&gt;&lt;P&gt;I need a chart that returns:&lt;/P&gt;&lt;P&gt;numofcampaings | qttyofusers&lt;BR /&gt;1 | 15320 - number os persons that participated of just 1 campaing&lt;BR /&gt;2 | 650 - number os persons that participated of 2 campaings&lt;BR /&gt;3 | 120 - number os persons that participated of 3 campaings&lt;BR /&gt;4 | 25 - number os persons that participated of 4 campaings&lt;/P&gt;&lt;P&gt;Anyone can help me?&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2009 00:34:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-do-this-query/m-p/144293#M505781</guid>
      <dc:creator />
      <dc:date>2009-05-16T00:34:22Z</dc:date>
    </item>
    <item>
      <title>How to do this query?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-do-this-query/m-p/144294#M505782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT customer_id, customer_name, Count(campaign_id) As campaign_count&lt;/P&gt;&lt;P&gt;FROM customer, participation&lt;/P&gt;&lt;P&gt;WHERE customer.customer_id = participation.customer_id&lt;/P&gt;&lt;P&gt;GROUP BY customer_id, customer_name&lt;/P&gt;&lt;P&gt;You could use that in place of loading the Customer table by itself. You would still probably want to load the Campaign and Participation tables as are. Then in your expressions, use Set Analysis to get the counts.&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;campaign_count = {1}&amp;gt;}, 1, 0) would be the number that participated in 1 campaign.&lt;/P&gt;&lt;P&gt;The above query is Oracle SQL, here's T-SQL is you prefer:&lt;/P&gt;&lt;P&gt;SELECT customer_id, customer_name, Count(campaign_id) As campaign_count&lt;/P&gt;&lt;P&gt;FROM customer INNER JOIN participation ON customer.customer_id = participation.customer_id&lt;/P&gt;&lt;P&gt;GROUP BY customer_id, customer_name&lt;/P&gt;&lt;P&gt;I'd also expect that this could be done by simply loading your tables individually and then using expressions to do all the dirty work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2009 02:33:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-do-this-query/m-p/144294#M505782</guid>
      <dc:creator />
      <dc:date>2009-05-16T02:33:30Z</dc:date>
    </item>
    <item>
      <title>How to do this query?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-do-this-query/m-p/144295#M505783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;the way to go is having a aggregated calculated dimension :&lt;/P&gt;&lt;P&gt;&lt;B&gt;aggr(count(campaign_id),customer_id)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;and display expression :&lt;/P&gt;&lt;P style="font-weight: bold"&gt;count(distinct customer_id)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2009 16:52:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-do-this-query/m-p/144295#M505783</guid>
      <dc:creator>yblake</dc:creator>
      <dc:date>2009-05-16T16:52:04Z</dc:date>
    </item>
  </channel>
</rss>

