<?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 - creating calculated dimention in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/set-analysis-creating-calculated-dimention/m-p/339740#M493851</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, you can't use Set Analysis this way, for a few reasons. The main problem is that the Set Analysis condition is being validated once for the whole chart, not for each row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your data is small enough, you can get by with the calculated dimension the way you created it. It will be slower than it shoudl be...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way of solving this problem is creating a flag in the load script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;IF (Begin + New &amp;lt;&amp;gt; End, 1, null()) as AgencyFlag&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then your expression could simply look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;AgencyFlag={1}&amp;gt;} Whatever)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd also recommend implementing it in the Expression and not in the Calculated Dimension, because calculated dimensions are much heavier than expressions, in terms of performance.&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;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 May 2012 17:56:27 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2012-05-07T17:56:27Z</dc:date>
    <item>
      <title>set analysis - creating calculated dimention</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-creating-calculated-dimention/m-p/339739#M493850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create a calculated dimention and having an issue with getting my set analysis to work. Any feedback is greatly apreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i need to do is to display [Agency Name] for any time row in a orders table that has "(Begin+New) &amp;lt;&amp;gt; End" condition.&lt;/P&gt;&lt;P&gt;Table look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 50%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Header 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Header 2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Header 3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Header 4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Header 5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Row 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&gt;, [Agency Name])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do something like this (Begin + New)?&lt;/P&gt;&lt;P&gt;=aggr(&lt;/P&gt;&lt;P&gt;IF(Count( {$&amp;lt;([Begin]+[New]) = {'&amp;lt;&amp;gt;[End]'} &amp;gt;} [Row ID]) &amp;gt; 0,[Agency Name])&lt;/P&gt;&lt;P&gt;, [Agency Name])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 17:48:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-creating-calculated-dimention/m-p/339739#M493850</guid>
      <dc:creator />
      <dc:date>2012-05-07T17:48:04Z</dc:date>
    </item>
    <item>
      <title>set analysis - creating calculated dimention</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-creating-calculated-dimention/m-p/339740#M493851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, you can't use Set Analysis this way, for a few reasons. The main problem is that the Set Analysis condition is being validated once for the whole chart, not for each row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your data is small enough, you can get by with the calculated dimension the way you created it. It will be slower than it shoudl be...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way of solving this problem is creating a flag in the load script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;IF (Begin + New &amp;lt;&amp;gt; End, 1, null()) as AgencyFlag&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then your expression could simply look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;AgencyFlag={1}&amp;gt;} Whatever)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd also recommend implementing it in the Expression and not in the Calculated Dimension, because calculated dimensions are much heavier than expressions, in terms of performance.&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;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 17:56:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-creating-calculated-dimention/m-p/339740#M493851</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2012-05-07T17:56:27Z</dc:date>
    </item>
    <item>
      <title>set analysis - creating calculated dimention</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-creating-calculated-dimention/m-p/339741#M493852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you Oleg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping to acompish this without modifying the script, but looks like i'll have too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-Sergey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 May 2012 18:04:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-creating-calculated-dimention/m-p/339741#M493852</guid>
      <dc:creator />
      <dc:date>2012-05-07T18:04:26Z</dc:date>
    </item>
  </channel>
</rss>

