<?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: Problem with IF/Then logic in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-IF-Then-logic/m-p/365908#M136132</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of an IF statement try using set analysis:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({&amp;lt;IND={A}&amp;gt;} Ethnic)&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;Count({&amp;lt;[Term Yr]={"&amp;lt;0"}&amp;gt;} Ethnic)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 24 Jun 2012 21:56:54 GMT</pubDate>
    <dc:creator>Jason_Michaelides</dc:creator>
    <dc:date>2012-06-24T21:56:54Z</dc:date>
    <item>
      <title>Problem with IF/Then logic</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-IF-Then-logic/m-p/365907#M136131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I am try to create an expression that will look at an employees status (Active (A) or InActive (I)) and based on their status count their ethnicity.&amp;nbsp; I am trying to use a simple IF/Then/Else statement, but it isn't recognizing the criteria:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt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gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The results are displaying the '1'.&amp;nbsp; If I change the = to not equal (&amp;lt;&amp;gt;), then the results are counting ALL employees by their ethnicity.&amp;nbsp; I ultimately want a count (by ethnicity) of all active employees and then a count (by ethnicity) of all inactive employees&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;(&lt;SPAN style="color: #800000;"&gt;[IND]&lt;/SPAN&gt;='A',&lt;SPAN style="color: #0000ff;"&gt;Count&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;[Ethnic]&lt;/SPAN&gt;),'1') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;([&lt;SPAN style="color: #800000;"&gt;IND]&lt;/SPAN&gt;='I',&lt;SPAN style="color: #0000ff;"&gt;Count&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;[Ethnic]&lt;/SPAN&gt;),'1') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Would I be able to do the same type of logic checking if the employee has a term year?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;If([Term Yr]&amp;lt;0,Count([Ethnic]) to count active employees&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;If([Term Yr]&amp;gt;0,Count([Ethnic]) to count inactive employees&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;My source is an Excel file, if that makes a difference.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks in advanced&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Mauricio&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jun 2012 20:53:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-IF-Then-logic/m-p/365907#M136131</guid>
      <dc:creator />
      <dc:date>2012-06-24T20:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with IF/Then logic</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-IF-Then-logic/m-p/365908#M136132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of an IF statement try using set analysis:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({&amp;lt;IND={A}&amp;gt;} Ethnic)&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;Count({&amp;lt;[Term Yr]={"&amp;lt;0"}&amp;gt;} Ethnic)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jun 2012 21:56:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-IF-Then-logic/m-p/365908#M136132</guid>
      <dc:creator>Jason_Michaelides</dc:creator>
      <dc:date>2012-06-24T21:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with IF/Then logic</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-IF-Then-logic/m-p/365909#M136133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jason for the quick response.&amp;nbsp; It worked like a charm!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mauricio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jun 2012 22:31:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-IF-Then-logic/m-p/365909#M136133</guid>
      <dc:creator />
      <dc:date>2012-06-24T22:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with IF/Then logic</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-IF-Then-logic/m-p/365910#M136134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick response Jason.&amp;nbsp; It worked like a charm&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mauricio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jun 2012 22:33:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-IF-Then-logic/m-p/365910#M136134</guid>
      <dc:creator />
      <dc:date>2012-06-24T22:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with IF/Then logic</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-IF-Then-logic/m-p/365911#M136135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&amp;nbsp; Is there a way for me to take the set analysis function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({&amp;lt;IND={A}&amp;gt;} Ethnic)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and use it to get the percentage of ethnicity based on the total of all ethnicity?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Asian&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 432&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 43.7%&lt;/P&gt;&lt;P&gt;Black&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 196&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19.8%&lt;/P&gt;&lt;P&gt;Hispanic 360&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 36.4%&lt;/P&gt;&lt;P&gt;&amp;nbsp; TOTAL&amp;nbsp; 988&amp;nbsp;&amp;nbsp; 100.0%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&amp;nbsp; Did you take an advanced class to learn these tricks or was it just learning by doing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;Mauricio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 07:11:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-IF-Then-logic/m-p/365911#M136135</guid>
      <dc:creator />
      <dc:date>2012-06-25T07:11:51Z</dc:date>
    </item>
  </channel>
</rss>

