<?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: Issue with &amp;quot;Where&amp;quot; function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Issue-with-quot-Where-quot-function/m-p/132844#M9384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried to use COUNT(DISTINCT ID). maybe you've got the same rows multiple times in your dataset. So you'll see 1 row, but basically there are more rows. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Oct 2018 13:08:18 GMT</pubDate>
    <dc:creator>avkeep01</dc:creator>
    <dc:date>2018-10-24T13:08:18Z</dc:date>
    <item>
      <title>Issue with "Where" function</title>
      <link>https://community.qlik.com/t5/App-Development/Issue-with-quot-Where-quot-function/m-p/132843#M9383</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;In my data load script I am currently using a where statement to filter out unnecessary strings.&lt;/P&gt;&lt;P&gt;The code looks as follows:&lt;/P&gt;&lt;P&gt;1st script, to allow for the where statement to be found:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15403829196877739" jivemacro_uid="_15403829196877739"&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Load*,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; If("Action type"='Organization Reassignment' and "Action Reason"='Promotion within band' or "Action Reason"='Promotion - Band Up' or "Action Reason"='Lateral Move', 'In Scope',&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; if("Action type"='Termination-Voluntary' or "Action type"='Termination-Involuntary','In Scope', 'Out of Scope' ))as "Movement Exclusion";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Load&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"Personal ID",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Name Movement",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"Employee Group Movement",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"Date of the Movement",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Action type",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Action Reason",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Band Before",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"Position ID Before",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"Position Before",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"Function Before",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"Band After",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"Position ID After",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"Position After",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"Function After",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"In scope for Turnover?",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;"TO Filter"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident Action_Report;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Drop table Action_Report;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;2nd script that utilizes the where statement:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15403830038622974" jivemacro_uid="_15403830038622974"&gt;
&lt;P&gt; Movement:&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;"Personal ID",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Name Movement",&lt;/P&gt;
&lt;P&gt;"Employee Group Movement",&lt;/P&gt;
&lt;P&gt;"Date of the Movement",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Action type",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Action Reason",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Band Before",&lt;/P&gt;
&lt;P&gt;"Position ID Before",&lt;/P&gt;
&lt;P&gt;"Position Before",&lt;/P&gt;
&lt;P&gt;"Function Before",&lt;/P&gt;
&lt;P&gt;"Band After",&lt;/P&gt;
&lt;P&gt;"Position ID After",&lt;/P&gt;
&lt;P&gt;"Position After",&lt;/P&gt;
&lt;P&gt;"Function After",&lt;/P&gt;
&lt;P&gt;"Movement Exclusion",&lt;/P&gt;
&lt;P&gt;"TO Filter"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident Movements&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where "Movement Exclusion"='In Scope' and "TO Filter"='In Scope';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Drop table Movements;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt; Outer Join(Employee_Report)&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This an example of the source data&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;ID&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;Name&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;Action 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;Action Reason&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1002&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;John Doe&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Organization Reassignment&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Promotion - Band Up&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1002&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;John Doe&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Medical Leave&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Long-Term Disability&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1122&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Jack Johnson&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Hiring-Employees&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;New Position&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per the "Movement Exception" rule applied through the "Where" function, only the first line will be shown in Qlik Sense, where as the last 2 lines are not shown due to the "where" function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This all works perfect, however the count function still seems to recognize the 2 excluded lines. So when I create a table I will only see one line (The top one), but when I add in a KPI for count(ID), or add the count function into a bar chart or anywhere else, I still get 3 ID's as a count. Even though they are excluded through the "Where" function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I fix this issue? Anyone any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 12:50:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Issue-with-quot-Where-quot-function/m-p/132843#M9383</guid>
      <dc:creator>robin_heijt</dc:creator>
      <dc:date>2018-10-24T12:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with "Where" function</title>
      <link>https://community.qlik.com/t5/App-Development/Issue-with-quot-Where-quot-function/m-p/132844#M9384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried to use COUNT(DISTINCT ID). maybe you've got the same rows multiple times in your dataset. So you'll see 1 row, but basically there are more rows. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 13:08:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Issue-with-quot-Where-quot-function/m-p/132844#M9384</guid>
      <dc:creator>avkeep01</dc:creator>
      <dc:date>2018-10-24T13:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with "Where" function</title>
      <link>https://community.qlik.com/t5/App-Development/Issue-with-quot-Where-quot-function/m-p/132845#M9385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I forgot to mention, Count distinct indeed works correct. But I would have to apply distinct within every graph and KPI, I would somehow like to add this distinct function within the data load script. Do you have any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 13:09:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Issue-with-quot-Where-quot-function/m-p/132845#M9385</guid>
      <dc:creator>robin_heijt</dc:creator>
      <dc:date>2018-10-24T13:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with "Where" function</title>
      <link>https://community.qlik.com/t5/App-Development/Issue-with-quot-Where-quot-function/m-p/132846#M9386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try adding Distinct to the load statement ("Movement: Load Distinct... Resident Movements"). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or d&lt;SPAN style="font-size: 13.3333px;"&gt;oes your load, into the "Movement" table, have so much detail in other fields that cause multiple rows per ID despite a "Load Distinct"? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;If you can't avoid loading those fields, you'll have to use the Count(Distinct ID) everywhere. (You can make life easier in the long term by creating a variable or master measure.)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 19:30:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Issue-with-quot-Where-quot-function/m-p/132846#M9386</guid>
      <dc:creator>Lauri</dc:creator>
      <dc:date>2018-10-24T19:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with "Where" function</title>
      <link>https://community.qlik.com/t5/App-Development/Issue-with-quot-Where-quot-function/m-p/132847#M9387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll need to check your script to figure out why there are multiple rows. Maybe a join or something.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 19:58:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Issue-with-quot-Where-quot-function/m-p/132847#M9387</guid>
      <dc:creator>avkeep01</dc:creator>
      <dc:date>2018-10-24T19:58:25Z</dc:date>
    </item>
  </channel>
</rss>

