<?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 Re: Calculated Dimension - Multiple non-nested IFs in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Multiple-non-nested-IFs/m-p/659176#M240474</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks for replying, but that still doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forgot to mention in my original post that the expression I am then using is a simple, COUNT( account_id).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess it doesn't work because any account_id is only being placed in one of the slots of 0+ or 1+, etc. Whereas I need the same account_id to be present in 0+ and 1+ if he has made 2 deposits.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jun 2014 11:16:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-26T11:16:26Z</dc:date>
    <item>
      <title>Calculated Dimension - Multiple non-nested IFs</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Multiple-non-nested-IFs/m-p/659174#M240472</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;Assume the following data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Player:&lt;/P&gt;&lt;P&gt;signup_month&lt;/P&gt;&lt;P&gt;account_id&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transactions:&lt;/P&gt;&lt;P&gt;transaction_date&lt;/P&gt;&lt;P&gt;account_id&lt;/P&gt;&lt;P&gt;number_of_deposits&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get a table in the following format:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Number of deposits:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1,000&lt;/P&gt;&lt;P&gt;1+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&lt;/P&gt;&lt;P&gt;2+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is read as, there are 1,000 customers, of whom 500 made 1 or more deposits, 200 made 2 or more deposits, etc.&lt;/P&gt;&lt;P&gt;Obviously, the 2+ is a subset of the 1+ group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get close to a solution by using a calculated dimension of the form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=AGGR( if(sum(number_of_deposits) = 0, '0',&lt;/P&gt;&lt;P&gt;if(sum(number_of_deposits) = 1, '1',&lt;/P&gt;&lt;P&gt;if(sum(number_of_deposits) &amp;gt;=2, '2+', 'Error'), account_id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However with this I can only see those who made exactly 0 deposits, exactly 1 deposits etc. giving me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 300&lt;/P&gt;&lt;P&gt;2+&amp;nbsp;&amp;nbsp; 200&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I change the above '=' to '&amp;gt;=', then I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1,000&lt;/P&gt;&lt;P&gt;and nothing else, as QV stops evaluating the IF on the first clause. This stands to reason as it is an IF..THEN..ELSE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on how I can solve this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 10:43:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Multiple-non-nested-IFs/m-p/659174#M240472</guid>
      <dc:creator />
      <dc:date>2014-06-26T10:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension - Multiple non-nested IFs</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Multiple-non-nested-IFs/m-p/659175#M240473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Write If with reverse condition(check bigger number first) like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=AGGR( if(sum(number_of_deposits) &amp;gt;= 2, '2+',&lt;/P&gt;&lt;P&gt;if(sum(number_of_deposits) &amp;gt;= 1, '1+',&lt;/P&gt;&lt;P&gt;if(sum(number_of_deposits) &amp;gt;=0, '0+', 'Error'), account_id)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 10:48:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Multiple-non-nested-IFs/m-p/659175#M240473</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-06-26T10:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension - Multiple non-nested IFs</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Multiple-non-nested-IFs/m-p/659176#M240474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thanks for replying, but that still doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forgot to mention in my original post that the expression I am then using is a simple, COUNT( account_id).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess it doesn't work because any account_id is only being placed in one of the slots of 0+ or 1+, etc. Whereas I need the same account_id to be present in 0+ and 1+ if he has made 2 deposits.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 11:16:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Multiple-non-nested-IFs/m-p/659176#M240474</guid>
      <dc:creator />
      <dc:date>2014-06-26T11:16:26Z</dc:date>
    </item>
  </channel>
</rss>

