<?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 (error) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447048#M489261</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably have to aggregate over your dimensions.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;aggr(IF&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;AMOUNT&lt;/SPAN&gt;&amp;gt;0, &lt;SPAN style="color: #0000ff;"&gt;Count&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;DISTINCT&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;DOS&lt;/SPAN&gt;&amp;amp;'-'&amp;amp;&lt;SPAN style="color: #800000;"&gt;PAT_ENC_CSN_ID&lt;/SPAN&gt;&amp;amp;'-'&amp;amp; &lt;SPAN style="color: #800000;"&gt;[Proc Code]&lt;/SPAN&gt;&amp;amp;'-'&amp;amp;&lt;SPAN style="color: #800000;"&gt;[Prov ID]))&lt;/SPAN&gt;, 0), dim1,dim2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use a straight table you could set the Total Mode of the expression to Sum of Rows.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Nov 2012 15:20:37 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2012-11-19T15:20:37Z</dc:date>
    <item>
      <title>IF Statement (error)</title>
      <link>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447047#M489260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am thinking this is an easy fix-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count Concatenate&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;IF&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;AMOUNT&lt;/SPAN&gt;&amp;gt;0, &lt;SPAN style="color: #0000ff;"&gt;Count&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;DISTINCT&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;DOS&lt;/SPAN&gt;&amp;amp;'-'&amp;amp;&lt;SPAN style="color: #800000;"&gt;PAT_ENC_CSN_ID&lt;/SPAN&gt;&amp;amp;'-'&amp;amp; &lt;SPAN style="color: #800000;"&gt;[Proc Code]&lt;/SPAN&gt;&amp;amp;'-'&amp;amp;&lt;SPAN style="color: #800000;"&gt;[Prov ID]))&lt;/SPAN&gt;, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see the individual counts working, but the total shows 0. Any idea why this is happening?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="25300" class="jive-image" alt="Screenshot.gif" src="https://community.qlik.com/legacyfs/online/25300_Screenshot.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~EK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 15:13:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447047#M489260</guid>
      <dc:creator />
      <dc:date>2012-11-19T15:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: IF Statement (error)</title>
      <link>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447048#M489261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably have to aggregate over your dimensions.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;aggr(IF&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;AMOUNT&lt;/SPAN&gt;&amp;gt;0, &lt;SPAN style="color: #0000ff;"&gt;Count&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;DISTINCT&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;DOS&lt;/SPAN&gt;&amp;amp;'-'&amp;amp;&lt;SPAN style="color: #800000;"&gt;PAT_ENC_CSN_ID&lt;/SPAN&gt;&amp;amp;'-'&amp;amp; &lt;SPAN style="color: #800000;"&gt;[Proc Code]&lt;/SPAN&gt;&amp;amp;'-'&amp;amp;&lt;SPAN style="color: #800000;"&gt;[Prov ID]))&lt;/SPAN&gt;, 0), dim1,dim2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use a straight table you could set the Total Mode of the expression to Sum of Rows.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 15:20:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447048#M489261</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-19T15:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: IF Statement (error)</title>
      <link>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447049#M489262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As easy as switching the total mode. Thanks for the extra set of eyes!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-EK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 15:32:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447049#M489262</guid>
      <dc:creator />
      <dc:date>2012-11-19T15:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: IF Statement (error)</title>
      <link>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447050#M489263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wondering if you could help with making this IF statement a little more complicated. I have 2 procedure codes that would skew my data. 99291-is a code listed for 30-74 min of a hospital visit. Once the visit exceeds that time-99292 would be used to show that an additional 30 min was needed for the visit and so on. My current concatenation would count that twice as they are different [Proc Code]s. Do you know what to add so that proc codes 99291 and 99292 are only counted once if listed on the same day?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-EK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 16:11:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447050#M489263</guid>
      <dc:creator />
      <dc:date>2012-11-19T16:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: IF Statement (error)</title>
      <link>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447051#M489264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({&amp;lt;AMOUNT={'&amp;gt;0'},[Proc code] -={'9929*'}&amp;gt;+&amp;lt;AMOUNT={'&amp;gt;0'},[Proc code]={'99291'}&amp;gt;} DISTINCT(DOS&amp;amp;'-'&amp;amp;PAT_ENC_CSN_ID&amp;amp;'-'&amp;amp; [Proc Code]&amp;amp;'-'&amp;amp;[Prov ID]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should count all records where AMOUNT &amp;gt; 0 and Proc code doesn't start with 9929, unless it's 99291.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 18:31:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447051#M489264</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-19T18:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: IF Statement (error)</title>
      <link>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447052#M489265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmmm still doesnt seem to be recognizing the formula. When i paste this formula in- &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;{'9929*'}&amp;gt;+&amp;lt;AMOUNT={'&amp;gt;0'},[Proc code]={'99291'}&amp;gt;} DISTINCT(DOS&amp;amp;'-'&amp;amp;PAT_ENC_CSN_ID&amp;amp;'-'&amp;amp; [Proc Code]&amp;amp;'-'&amp;amp;[Prov ID])) &lt;/SPAN&gt;is highlighted in red. I can imagine this is a little difficult when you are not working with real fields. I don't own this app either so not sure how I could send you a template version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i get rid of the negative sign before the equal sign -={"9929*} it likes the formula, although ithat changes the formula to include vs exclude.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 20:45:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IF-Statement-error/m-p/447052#M489265</guid>
      <dc:creator />
      <dc:date>2012-11-19T20:45:18Z</dc:date>
    </item>
  </channel>
</rss>

