<?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 Conditional count in charts in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/361996#M134567</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem implementing the following in QlikView (10)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to count persons with a specific number of actions and visualize those values in a chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(distinct person_id) where no_of_actions = 1 &lt;/P&gt;&lt;P&gt;count(distinct person_id) where no_of_actions = 2&lt;/P&gt;&lt;P&gt;count(distinct person_id) where no_of_actions = 3&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I calculate the number of actions using an if-statement:&lt;/P&gt;&lt;P&gt;if(item_typ=action, sum(action_quantity))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "normal" way I see conditional count is&lt;/P&gt;&lt;P&gt;count(distinct if(no_of_actions=1), person_id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would however need to integrate the if-statement, because no_of_actions doesn't exist as a field, but is only calculated (also the number of actions should be seen per person). How can I achieve this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Mar 2012 10:41:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-03-21T10:41:44Z</dc:date>
    <item>
      <title>Conditional count in charts</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/361996#M134567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem implementing the following in QlikView (10)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to count persons with a specific number of actions and visualize those values in a chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(distinct person_id) where no_of_actions = 1 &lt;/P&gt;&lt;P&gt;count(distinct person_id) where no_of_actions = 2&lt;/P&gt;&lt;P&gt;count(distinct person_id) where no_of_actions = 3&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I calculate the number of actions using an if-statement:&lt;/P&gt;&lt;P&gt;if(item_typ=action, sum(action_quantity))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "normal" way I see conditional count is&lt;/P&gt;&lt;P&gt;count(distinct if(no_of_actions=1), person_id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would however need to integrate the if-statement, because no_of_actions doesn't exist as a field, but is only calculated (also the number of actions should be seen per person). How can I achieve this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 10:41:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/361996#M134567</guid>
      <dc:creator />
      <dc:date>2012-03-21T10:41:44Z</dc:date>
    </item>
    <item>
      <title>Conditional count in charts</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/361997#M134568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you specify what no_of_actions is? A Variable? Try using set analysis. IF statement has an impact on performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;count(&lt;/SPAN&gt; {$&amp;lt;no_of_actions = {1}&amp;gt;} DISTINCT person_id &lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 11:05:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/361997#M134568</guid>
      <dc:creator>jvitantonio</dc:creator>
      <dc:date>2012-03-21T11:05:25Z</dc:date>
    </item>
    <item>
      <title>Conditional count in charts</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/361998#M134569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;count(&lt;/SPAN&gt; {$&amp;lt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;person_id&lt;/SPAN&gt;= {“=sum&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;({&amp;lt;item_typ={"action"}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;action_quantity) = 1&lt;/SPAN&gt;”}&amp;gt;} &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;distinct person_id&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;count(&lt;/SPAN&gt; {$&amp;lt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;person_id&lt;/SPAN&gt;= {“=sum&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;({&amp;lt;item_typ={"action"}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;action_quantity) = 2&lt;/SPAN&gt;”}&amp;gt;} &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;distinct person_id&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;count(&lt;/SPAN&gt; {$&amp;lt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;person_id&lt;/SPAN&gt;= {“=sum&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;({&amp;lt;item_typ={"action"}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;action_quantity) = 3&lt;/SPAN&gt;”}&amp;gt;} &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;distinct person_id&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;succes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Halmar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 11:09:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/361998#M134569</guid>
      <dc:creator />
      <dc:date>2012-03-21T11:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional count in charts</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/361999#M134570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; no_of_actions is something I calculate, it's actually kind of non-existent &lt;BR /&gt;as mentioned above it's calculated: if(item_typ=action, sum(action_quantity))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 11:20:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/361999#M134570</guid>
      <dc:creator />
      <dc:date>2012-03-21T11:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional count in charts</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/362000#M134571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hello Halmar, &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This looks like what I am looking for. I get a syntax error however, when I try to use it.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;&lt;BR /&gt;count(&lt;/SPAN&gt; {$&amp;lt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;person_id &lt;/SPAN&gt;&lt;STRONG style="color: #ff0000;"&gt;= &lt;/STRONG&gt;{“=sum&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;({&amp;lt;item_typ={"action"}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;action_quantity) = 1&lt;/SPAN&gt;”}&amp;gt;} &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;distinct person_id&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Unfortunately I am not familar enough with set analysis to solve it myself. &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Susann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 11:27:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/362000#M134571</guid>
      <dc:creator />
      <dc:date>2012-03-21T11:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional count in charts</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/362001#M134572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I solved it. It should be:&lt;BR /&gt;&lt;SPAN class="Bold"&gt;count(&lt;/SPAN&gt;distinct {$&amp;lt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;person_id&lt;/SPAN&gt;= {“=sum&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;({&amp;lt;item_typ='action'&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;action_quantity) = 1&lt;/SPAN&gt;”}&amp;gt;} &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;person_id&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 13:52:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-count-in-charts/m-p/362001#M134572</guid>
      <dc:creator />
      <dc:date>2012-03-21T13:52:29Z</dc:date>
    </item>
  </channel>
</rss>

