<?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: 'if' statement works in straight table but not Text object in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631806#M1088568</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Sum(Aggr(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;if (count ({&amp;lt;Delivered -= '0')&amp;gt;} distinct Accounts) = 0, count (Accounts), 0)&lt;/SPAN&gt;, Dim1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;&lt;P&gt;Dim1 is the dimension used in the straight table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 May 2014 05:56:50 GMT</pubDate>
    <dc:creator>MayilVahanan</dc:creator>
    <dc:date>2014-05-29T05:56:50Z</dc:date>
    <item>
      <title>'if' statement works in straight table but not Text object</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631804#M1088566</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;My data contains Accounts, Tasks and Delivered Status.&amp;nbsp; The status can be "delivered" (1), "not delivered" (-1) or "not actioned" (0).&amp;nbsp; I want a count of all the accounts that ONLY have "not actioned" or blank.&amp;nbsp; In other words i'm trying to find accounts that have zero activity.&amp;nbsp; My thought was to count delivered and not delivered - if this was zero, then count that account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My expression is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if (count ({&amp;lt;Delivered -= '0')&amp;gt;} distinct Accounts) = 0, count (Accounts), 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works in a straight table and it lists the accounts.&amp;nbsp; However, I want it represented as a single number via Text Box which returns a 0 (zero).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should i be using another expression? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 05:27:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631804#M1088566</guid>
      <dc:creator />
      <dc:date>2014-05-29T05:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: 'if' statement works in straight table but not Text object</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631805#M1088567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be simply&amp;nbsp; = Count ({&amp;lt;Delivered-={1,-1}&amp;gt;} Distinct Accounts) ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 05:56:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631805#M1088567</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-05-29T05:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: 'if' statement works in straight table but not Text object</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631806#M1088568</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Sum(Aggr(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;if (count ({&amp;lt;Delivered -= '0')&amp;gt;} distinct Accounts) = 0, count (Accounts), 0)&lt;/SPAN&gt;, Dim1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;&lt;P&gt;Dim1 is the dimension used in the straight table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 05:56:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631806#M1088568</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2014-05-29T05:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: 'if' statement works in straight table but not Text object</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631807#M1088569</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;You can use simply like&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; Count ({&amp;lt;Delivered-={1,-1}&amp;gt;} Distinct Accounts) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Deepak&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 06:08:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631807#M1088569</guid>
      <dc:creator />
      <dc:date>2014-05-29T06:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: 'if' statement works in straight table but not Text object</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631808#M1088570</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;Is the 'blank' Delivered Status a null? If it is an empty string, then tresesco's&amp;nbsp; expression should meet your requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is null, then you have a problem. Set expressions work the same as selections from the front end, and you cannot select null values. In the same way, you cannot select null values using a set expression. So &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;{&amp;lt;Delivered-={1,-1}&amp;gt;} &lt;/SPAN&gt;will return the zeroes, but not the nulls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use Sum(If()), like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(Distinct If(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.333333969116211px;"&gt;Delivered = 0 Or IsNull(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.333333969116211px;"&gt;Delivered), Accounts, 0))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will select nulls, but Sum(If()) is a performance killer in larger data sets. So if you cannot use Sum(If()), then you have two options:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Apply NullAsValue to the field. Then &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;{&amp;lt;Delivered-={1,-1}&amp;gt;} will select the nulls (now blanks) and 0's&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Before the LOAD, add the line:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&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; NULLASVALUE Delivered;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Set a flag to indicate the null value, and use this flag in the expression. Something like:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD ....&lt;/P&gt;&lt;P&gt;&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; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Delivered,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&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; If(IsNull(Delivered) Or Delivered = 0, 1, 0)&amp;nbsp; As DeliveredNoAction,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&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; ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Now your expression is Sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;DeliveredNoAction&lt;/SPAN&gt;={1}&amp;gt;} Distinct Accounts)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 06:19:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631808#M1088570</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-05-29T06:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: 'if' statement works in straight table but not Text object</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631809#M1088571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;HI&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=if (count ({&amp;lt;Delivered ={*}- {0})&amp;gt;} distinct Accounts) = 0, count (Accounts), null())&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 06:45:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631809#M1088571</guid>
      <dc:creator>sasikanth</dc:creator>
      <dc:date>2014-05-29T06:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: 'if' statement works in straight table but not Text object</title>
      <link>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631810#M1088572</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;Thanks! This worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 00:25:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-statement-works-in-straight-table-but-not-Text-object/m-p/631810#M1088572</guid>
      <dc:creator />
      <dc:date>2014-05-30T00:25:54Z</dc:date>
    </item>
  </channel>
</rss>

