<?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: count expression with if statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169795#M893020</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My bad I am not clear on the requirement.Sorry for any confusion. This is the output i want. I cannot share the app due security reasons. I will try to replicate the req and get the application uploaded sometime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;THEAD style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Record Type&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;table a&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;table b&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;table b (Replace-Route)&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;Table A - Table B &lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;New&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;2&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;2&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;NA&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;Replace&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;3&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;3&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;route&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;3&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;3&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;cancel&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;1&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;1&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;NA&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Aug 2016 18:17:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-08-10T18:17:17Z</dc:date>
    <item>
      <title>count expression with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169791#M893016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to get the difference between col 2 and col 3 for table b as shown in the table. I am using the expression as below and not quite successful. Please advice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;= if ([Record Type] = 'Replace',(count ({&amp;lt;Source = {'tableb'}&amp;gt; - &amp;lt;[Record Type] = {'Route'},Source = {'tableb'}&amp;gt;} [ID])))&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Record Type&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;table a&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;table b&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;table b (col2-col3)&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;New&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;NA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Replace&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;route&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;cancel&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;NA&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169791#M893016</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: count expression with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169792#M893017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is your expected output should be? Why Record Type 'New' and Cancel has NA ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aren't these (table a and table b) your actual column names ? If yes, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expr:&lt;/P&gt;&lt;P&gt;[table b] - [table a]&lt;/P&gt;&lt;P&gt;Should give you the results ? &lt;/P&gt;&lt;P&gt;What is the issue you are facing here ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 17:37:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169792#M893017</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2016-08-10T17:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: count expression with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169793#M893018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for a quick response. I need the difference between route and replace record types for table B. I am new to qlikview, my expression shows no errors but is not giving me a difference as 0 between 2 record types for same table ( table b). Since its just the difference between replace and route for table B , new and cancel has 'NA' - not applicable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 17:45:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169793#M893018</guid>
      <dc:creator />
      <dc:date>2016-08-10T17:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: count expression with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169794#M893019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share a sample app please ? And what is tableA here ? Are we using values from Table A? Sorry I quite did not understand what exactly you are trying to achieve? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 18:08:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169794#M893019</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2016-08-10T18:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: count expression with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169795#M893020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My bad I am not clear on the requirement.Sorry for any confusion. This is the output i want. I cannot share the app due security reasons. I will try to replicate the req and get the application uploaded sometime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;THEAD style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Record Type&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;table a&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;table b&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;table b (Replace-Route)&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;Table A - Table B &lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;New&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;2&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;2&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;NA&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;Replace&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;3&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;3&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;route&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;3&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;3&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;cancel&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;1&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;1&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;NA&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 18:17:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169795#M893020</guid>
      <dc:creator />
      <dc:date>2016-08-10T18:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: count expression with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169796#M893021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try these two and let me know ?&lt;/P&gt;&lt;P&gt;Make sure column names do not have spaces if using spaces then enclose them with '[' and this ']' else use as i used below using underscore ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim: RecordType&lt;/P&gt;&lt;P&gt;Expr1: Sum(table_a)&lt;/P&gt;&lt;P&gt;Expr2: Sum(table_b)&lt;/P&gt;&lt;P&gt;Expr3: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = IF(Match(RecordType, 'New','cancel'), 'NA',&amp;nbsp; Above(Sum(table_b),0) - Below(Sum(table_b),0) )&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;SPAN style="font-size: 13.3333px;"&gt;IF(Match(RecordType, 'New','cancel'), 'NA', &lt;/SPAN&gt;Sum({&amp;lt;RecordType = {'Replace, route'} &amp;gt;} table_b) -&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum({&amp;lt;RecordType = {'Replace,route'} &amp;gt;}table_b) ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expr4: = table_a - table_b&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;V.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 20:38:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169796#M893021</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2016-08-10T20:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: count expression with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169797#M893022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, It working fine...:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 21:07:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169797#M893022</guid>
      <dc:creator />
      <dc:date>2016-08-10T21:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: count expression with if statement</title>
      <link>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169798#M893023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem. Glad it help you. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 21:26:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-expression-with-if-statement/m-p/1169798#M893023</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2016-08-10T21:26:59Z</dc:date>
    </item>
  </channel>
</rss>

