<?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 Help with Set Expression usage in Bar Chart in Water Cooler</title>
    <link>https://community.qlik.com/t5/Water-Cooler/Help-with-Set-Expression-usage-in-Bar-Chart/m-p/679328#M3162</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;Can someone please help me with constructing a proper Bar Chart.&lt;/P&gt;&lt;P&gt;I'm trying to use a set-expression, instead of using a really REALLY SLOW sum(if(...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;QUALIFY *;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;ResourcePoolName, Capacity&lt;/P&gt;&lt;P&gt;Pool A, 100&lt;/P&gt;&lt;P&gt;Pool B, 200&lt;/P&gt;&lt;P&gt;Pool C, 300&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;PoolName, Demand, Person&lt;/P&gt;&lt;P&gt;Pool A, 50, Mirjam&lt;/P&gt;&lt;P&gt;Pool A, 25, Percy&lt;/P&gt;&lt;P&gt;Pool A, 10, Jerry&lt;/P&gt;&lt;P&gt;Pool B, 175, Jerry&lt;/P&gt;&lt;P&gt;Pool C, 100, Mirjam&lt;/P&gt;&lt;P&gt;Pool C, 100, Percy&lt;/P&gt;&lt;P&gt;Pool C, 100, Jerry&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2.PoolName field has a document trigger to also select the same Table1.ResourcePoolName. I have very good reasons for this, so please don't give any answers that the two fields should be named the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension in bar chart:&lt;/P&gt;&lt;P&gt;Table2.PoolName&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two expressions:&lt;/P&gt;&lt;P&gt;1. Demand:&amp;nbsp; sum(Table2.Demand)&lt;/P&gt;&lt;P&gt;2. Capacity: Difficulties here!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried:&lt;/P&gt;&lt;P&gt;2. sum(if(Table2.PoolName = Table1.ResourcePoolName, Table1.Capacity, 0))&amp;nbsp;&amp;nbsp; [error here because of counting doubles AND VERY VERY SLOW]&lt;/P&gt;&lt;P&gt;2. sum({$&amp;lt;Table1.ResourcePoolName = P(Table2.PoolName)&amp;gt;} Table1.Capacity)&amp;nbsp; [wrong]&lt;/P&gt;&lt;P&gt;2. sum({$&amp;lt;Table2.PoolName = P(Table1.ResourcePoolName)&amp;gt;} Table1.Capacity) [wrong too]&lt;/P&gt;&lt;P&gt;2. sum({$&amp;lt;Table1.ResourcePoolName = {$(=Table2.PoolName)} &amp;gt;} Table1.Capacity) [wrong]&lt;/P&gt;&lt;P&gt;2. sum({$&amp;lt;Table2.PoolName= {$(=Table1.ResourcePoolName )} &amp;gt;} Table1.Capacity) [wrong]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've heard the set expression is faster than the IF statement, but I can't get it to work.&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have other reasons why these are not coupled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Percy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jul 2014 16:25:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-15T16:25:13Z</dc:date>
    <item>
      <title>Help with Set Expression usage in Bar Chart</title>
      <link>https://community.qlik.com/t5/Water-Cooler/Help-with-Set-Expression-usage-in-Bar-Chart/m-p/679328#M3162</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;Can someone please help me with constructing a proper Bar Chart.&lt;/P&gt;&lt;P&gt;I'm trying to use a set-expression, instead of using a really REALLY SLOW sum(if(...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;QUALIFY *;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;ResourcePoolName, Capacity&lt;/P&gt;&lt;P&gt;Pool A, 100&lt;/P&gt;&lt;P&gt;Pool B, 200&lt;/P&gt;&lt;P&gt;Pool C, 300&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;PoolName, Demand, Person&lt;/P&gt;&lt;P&gt;Pool A, 50, Mirjam&lt;/P&gt;&lt;P&gt;Pool A, 25, Percy&lt;/P&gt;&lt;P&gt;Pool A, 10, Jerry&lt;/P&gt;&lt;P&gt;Pool B, 175, Jerry&lt;/P&gt;&lt;P&gt;Pool C, 100, Mirjam&lt;/P&gt;&lt;P&gt;Pool C, 100, Percy&lt;/P&gt;&lt;P&gt;Pool C, 100, Jerry&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2.PoolName field has a document trigger to also select the same Table1.ResourcePoolName. I have very good reasons for this, so please don't give any answers that the two fields should be named the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension in bar chart:&lt;/P&gt;&lt;P&gt;Table2.PoolName&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two expressions:&lt;/P&gt;&lt;P&gt;1. Demand:&amp;nbsp; sum(Table2.Demand)&lt;/P&gt;&lt;P&gt;2. Capacity: Difficulties here!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried:&lt;/P&gt;&lt;P&gt;2. sum(if(Table2.PoolName = Table1.ResourcePoolName, Table1.Capacity, 0))&amp;nbsp;&amp;nbsp; [error here because of counting doubles AND VERY VERY SLOW]&lt;/P&gt;&lt;P&gt;2. sum({$&amp;lt;Table1.ResourcePoolName = P(Table2.PoolName)&amp;gt;} Table1.Capacity)&amp;nbsp; [wrong]&lt;/P&gt;&lt;P&gt;2. sum({$&amp;lt;Table2.PoolName = P(Table1.ResourcePoolName)&amp;gt;} Table1.Capacity) [wrong too]&lt;/P&gt;&lt;P&gt;2. sum({$&amp;lt;Table1.ResourcePoolName = {$(=Table2.PoolName)} &amp;gt;} Table1.Capacity) [wrong]&lt;/P&gt;&lt;P&gt;2. sum({$&amp;lt;Table2.PoolName= {$(=Table1.ResourcePoolName )} &amp;gt;} Table1.Capacity) [wrong]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've heard the set expression is faster than the IF statement, but I can't get it to work.&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have other reasons why these are not coupled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Percy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2014 16:25:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Water-Cooler/Help-with-Set-Expression-usage-in-Bar-Chart/m-p/679328#M3162</guid>
      <dc:creator />
      <dc:date>2014-07-15T16:25:13Z</dc:date>
    </item>
  </channel>
</rss>

