<?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: ALT function not returning as expected? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/ALT-function-not-returning-as-expected/m-p/1092156#M937169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey John&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Alt checks for null, but as explained below where just completely pushes the data out of the table so ALT cannot check for something which doesn't exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) When you restrict something in Where clause, it never makes it to the table. So you cannot use conditions to be included in the table via Where clause. You have to use if or pick with Match/WilMatch/MixMatch to get it in the table but exclude from the calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it make sense? I feel it is hard to explain, may be somebody else can have a better explanation for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Feb 2016 18:15:03 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-02-10T18:15:03Z</dc:date>
    <item>
      <title>ALT function not returning as expected?</title>
      <link>https://community.qlik.com/t5/QlikView/ALT-function-not-returning-as-expected/m-p/1092153#M937166</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;I wanted to call the sum(revenue) from a resident table depending on a few criteria, and I want to display 0 if no criteria is met.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TotalRevenue:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Load &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alt(sum(revenue),0) as total_revenue&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;resident Revenue&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;where Is_Account_Active = 'Active'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;My observation:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM style="font-size: 13.3333px;"&gt;TotalRevenue &lt;/EM&gt;does not have any rows. If &lt;EM&gt;"Where"&lt;/EM&gt; is removed, then &lt;EM style="font-size: 13.3333px;"&gt;total_revenue &lt;/EM&gt;returns value as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Question:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; How can I ensure that even if no records are found using the &lt;EM&gt;"Where"&lt;/EM&gt; statement, I would still get 1 row for &lt;EM&gt;total_revenue&lt;/EM&gt; with 0 as the value?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 16:56:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ALT-function-not-returning-as-expected/m-p/1092153#M937166</guid>
      <dc:creator />
      <dc:date>2016-02-10T16:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: ALT function not returning as expected?</title>
      <link>https://community.qlik.com/t5/QlikView/ALT-function-not-returning-as-expected/m-p/1092154#M937167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be one of these based on the requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD If(&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Is_Account_Active &amp;lt;&amp;gt; 'Active', 0, Alt(Sum(revenue), 0)) as total_revenue&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident Revenue&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Group By &lt;/STRONG&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Is_Account_Active;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;LOAD &lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Alt(Sum(I&lt;STRONG style="font-size: 13.3333px;"&gt;f(&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Is_Account_Active = 'Active', &lt;/EM&gt;&lt;/STRONG&gt;revenue)), 0) as total_revenue&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident Revenue&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM style="line-height: 1.5em; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 17:35:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ALT-function-not-returning-as-expected/m-p/1092154#M937167</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-10T17:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: ALT function not returning as expected?</title>
      <link>https://community.qlik.com/t5/QlikView/ALT-function-not-returning-as-expected/m-p/1092155#M937168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your suggestion! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 follow-up questions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Why is it that the ALT function cannot return 0 when no records meet the criteria?&lt;/LI&gt;&lt;LI&gt;If i have multiple where conditions as opposed to "Account_Active='Active'", is there another way to do this without listing every condition into the if statement?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 17:44:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ALT-function-not-returning-as-expected/m-p/1092155#M937168</guid>
      <dc:creator />
      <dc:date>2016-02-10T17:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: ALT function not returning as expected?</title>
      <link>https://community.qlik.com/t5/QlikView/ALT-function-not-returning-as-expected/m-p/1092156#M937169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey John&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Alt checks for null, but as explained below where just completely pushes the data out of the table so ALT cannot check for something which doesn't exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) When you restrict something in Where clause, it never makes it to the table. So you cannot use conditions to be included in the table via Where clause. You have to use if or pick with Match/WilMatch/MixMatch to get it in the table but exclude from the calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it make sense? I feel it is hard to explain, may be somebody else can have a better explanation for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 18:15:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ALT-function-not-returning-as-expected/m-p/1092156#M937169</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-10T18:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: ALT function not returning as expected?</title>
      <link>https://community.qlik.com/t5/QlikView/ALT-function-not-returning-as-expected/m-p/1092157#M937170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;OL style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;
&lt;LI&gt;If i have multiple where conditions as opposed to "Account_Active='Active'", is there another way to do this without listing every condition into the if statement?&lt;/LI&gt;
&lt;/OL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;you can add a row, when there aren't rows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load 0 as total_revenue &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;AutoGenerate 1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Where NoOfRows('TotalRevenue') = 0;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2016 21:57:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ALT-function-not-returning-as-expected/m-p/1092157#M937170</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2016-02-10T21:57:35Z</dc:date>
    </item>
  </channel>
</rss>

