<?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 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/539012#M480598</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, everyone!&lt;/P&gt;&lt;P&gt;I need to count outlets that bought both of brands in a year in each month separately and in total.&lt;/P&gt;&lt;P&gt;Value for each brand I take from alternate states.&lt;/P&gt;&lt;P&gt;I tried this, but I had to use different formulas for months and total. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;if (&lt;SPAN style="color: #0000ff;"&gt;Dimensionality&lt;/SPAN&gt;()=1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;SubStringCount&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;concat&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({$*&lt;SPAN style="color: #0000ff;"&gt;[Brand Old]&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #800000;"&gt;H_IsSales&lt;/SPAN&gt;={1},&lt;SPAN style="color: #800000;"&gt;Year&lt;/SPAN&gt;={&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;$(=max(Year))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;}&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[Volume]&lt;/SPAN&gt;) &lt;SPAN style="color: #0000ff;"&gt;and&lt;/SPAN&gt; &lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({$*&lt;SPAN style="color: #0000ff;"&gt;[Brand New]&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #800000;"&gt;H_IsSales&lt;/SPAN&gt;={1},&lt;SPAN style="color: #800000;"&gt;Year&lt;/SPAN&gt;={&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;$(=max(Year))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;}&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[Volume]&lt;/SPAN&gt;),&lt;SPAN style="color: #800000;"&gt;[Outlet_code]&lt;/SPAN&gt;&amp;amp;'|'),&lt;SPAN style="color: #800000;"&gt;[Outlet_code]&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;Month&lt;/SPAN&gt;)), '|')),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;SubStringCount&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;concat&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({$*&lt;SPAN style="color: #0000ff;"&gt;[Brand Old]&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #800000;"&gt;H_IsSales&lt;/SPAN&gt;={1},&lt;SPAN style="color: #800000;"&gt;Year&lt;/SPAN&gt;={&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;$(=max(Year))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;}&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[Volume]&lt;/SPAN&gt;) &lt;SPAN style="color: #0000ff;"&gt;and&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({$*&lt;SPAN style="color: #0000ff;"&gt;[Brand New]&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #800000;"&gt;H_IsSales&lt;/SPAN&gt;={1},&lt;SPAN style="color: #800000;"&gt;Year&lt;/SPAN&gt;={&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;$(=max(Year))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;}&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[Volume]&lt;/SPAN&gt;),&lt;SPAN style="color: #800000;"&gt;[Outlet_code]&lt;/SPAN&gt;&amp;amp;'|'),&lt;SPAN style="color: #800000;"&gt;[Outlet_code]&lt;/SPAN&gt;)), '|'))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And when I use if statment, it takes a lot of time to generate my report. I need to make it faster.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas &lt;/SPAN&gt;&lt;SPAN&gt;how can I make this formula simpler?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Nov 2013 14:04:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-11-18T14:04:55Z</dc:date>
    <item>
      <title>Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/539012#M480598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, everyone!&lt;/P&gt;&lt;P&gt;I need to count outlets that bought both of brands in a year in each month separately and in total.&lt;/P&gt;&lt;P&gt;Value for each brand I take from alternate states.&lt;/P&gt;&lt;P&gt;I tried this, but I had to use different formulas for months and total. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;if (&lt;SPAN style="color: #0000ff;"&gt;Dimensionality&lt;/SPAN&gt;()=1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;SubStringCount&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;concat&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({$*&lt;SPAN style="color: #0000ff;"&gt;[Brand Old]&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #800000;"&gt;H_IsSales&lt;/SPAN&gt;={1},&lt;SPAN style="color: #800000;"&gt;Year&lt;/SPAN&gt;={&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;$(=max(Year))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;}&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[Volume]&lt;/SPAN&gt;) &lt;SPAN style="color: #0000ff;"&gt;and&lt;/SPAN&gt; &lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({$*&lt;SPAN style="color: #0000ff;"&gt;[Brand New]&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #800000;"&gt;H_IsSales&lt;/SPAN&gt;={1},&lt;SPAN style="color: #800000;"&gt;Year&lt;/SPAN&gt;={&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;$(=max(Year))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;}&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[Volume]&lt;/SPAN&gt;),&lt;SPAN style="color: #800000;"&gt;[Outlet_code]&lt;/SPAN&gt;&amp;amp;'|'),&lt;SPAN style="color: #800000;"&gt;[Outlet_code]&lt;/SPAN&gt;,&lt;SPAN style="color: #800000;"&gt;Month&lt;/SPAN&gt;)), '|')),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;SubStringCount&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;concat&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({$*&lt;SPAN style="color: #0000ff;"&gt;[Brand Old]&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #800000;"&gt;H_IsSales&lt;/SPAN&gt;={1},&lt;SPAN style="color: #800000;"&gt;Year&lt;/SPAN&gt;={&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;$(=max(Year))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;}&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[Volume]&lt;/SPAN&gt;) &lt;SPAN style="color: #0000ff;"&gt;and&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;({$*&lt;SPAN style="color: #0000ff;"&gt;[Brand New]&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #800000;"&gt;H_IsSales&lt;/SPAN&gt;={1},&lt;SPAN style="color: #800000;"&gt;Year&lt;/SPAN&gt;={&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;$(=max(Year))&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;}&amp;gt;}&lt;SPAN style="color: #800000;"&gt;[Volume]&lt;/SPAN&gt;),&lt;SPAN style="color: #800000;"&gt;[Outlet_code]&lt;/SPAN&gt;&amp;amp;'|'),&lt;SPAN style="color: #800000;"&gt;[Outlet_code]&lt;/SPAN&gt;)), '|'))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And when I use if statment, it takes a lot of time to generate my report. I need to make it faster.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas &lt;/SPAN&gt;&lt;SPAN&gt;how can I make this formula simpler?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 14:04:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/539012#M480598</guid>
      <dc:creator />
      <dc:date>2013-11-18T14:04:55Z</dc:date>
    </item>
  </channel>
</rss>

