<?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 Set Analysis, count distinct in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412901#M484058</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;In the attached qlikview document, the time periods are given as input box providing the users the flexibility to change time periods. I already have a text box with set analysis expression that calculates emp ID that overlap in both time period. I woud like to modify by set expression to answer the following - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;I need two text boxes -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt; &lt;SPAN style="font-size: 10pt;"&gt;First Expression - &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;I want to count the employees present in both time periods with same grade in both periods - The result should be 1 as you can see EmpID 2 is the only one that fits this criteria.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Second Expression - I want to count the employees present in both time periods and with only positive increase in grade points - The result should be 1 as you can see EmpID1 is the only one that fits this criteria as the grade points for ID -1 increased from 10 in 2009 to 20 in 2010. In my context it essentially calculates promotions in my dataset.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks a lot for your help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2013 01:06:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-05-28T01:06:24Z</dc:date>
    <item>
      <title>Set Analysis, count distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412901#M484058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;In the attached qlikview document, the time periods are given as input box providing the users the flexibility to change time periods. I already have a text box with set analysis expression that calculates emp ID that overlap in both time period. I woud like to modify by set expression to answer the following - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;I need two text boxes -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt; &lt;SPAN style="font-size: 10pt;"&gt;First Expression - &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;I want to count the employees present in both time periods with same grade in both periods - The result should be 1 as you can see EmpID 2 is the only one that fits this criteria.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Second Expression - I want to count the employees present in both time periods and with only positive increase in grade points - The result should be 1 as you can see EmpID1 is the only one that fits this criteria as the grade points for ID -1 increased from 10 in 2009 to 20 in 2010. In my context it essentially calculates promotions in my dataset.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks a lot for your help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 01:06:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412901#M484058</guid>
      <dc:creator />
      <dc:date>2013-05-28T01:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, count distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412902#M484059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the attachment&lt;/P&gt;&lt;P&gt;I have edited script to find the garden point is changed over the year.If changes it will show 1,from that you can find which empid got changed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 07:34:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412902#M484059</guid>
      <dc:creator>sivarajs</dc:creator>
      <dc:date>2013-05-28T07:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, count distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412903#M484060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Sivaraj, the expression is not working. This always counts 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attached qlikview document, the count needs to be 2 but it still shows 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: eiprakash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 14:18:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412903#M484060</guid>
      <dc:creator />
      <dc:date>2013-05-28T14:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, count distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412904#M484061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see the attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Mark Sheraton&#xD;
I've attached 3.1&amp;nbsp; as I made a change to expression 2 (I wasn't returning a count as you asked)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 16:25:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412904#M484061</guid>
      <dc:creator>RedSky001</dc:creator>
      <dc:date>2013-05-28T16:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, count distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412905#M484062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Mark for the expression, however for the attached test case it is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to count distinct employees stayed in the same grade. So in the pivot for Grade B the count should be 2 and it is calculating as 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: eiprakash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 19:25:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412905#M484062</guid>
      <dc:creator />
      <dc:date>2013-05-28T19:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, count distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412906#M484063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand why you're expecting a count of 2.&lt;/P&gt;&lt;P&gt;For grade B there is one employee who's grade is the same in 2009 as it is in 2010 and that's empid 2.&lt;/P&gt;&lt;P&gt;Please explain otherwise try the expressions below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculated dimension:&lt;/P&gt;&lt;P&gt;=AGGR(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(only({$&amp;lt;Year={'$(=To)'}&amp;gt;} [Graden points]) = only({$&amp;lt;Year={'$(=FromPeriod)'}&amp;gt;} [Graden points]),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Grade&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;,EmpID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;count(DISTINCT {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $&amp;lt;EmpID=p({$&amp;lt;Year={'$(=FromPeriod)'}&amp;gt;})&amp;gt;&amp;nbsp;&amp;nbsp; * $&amp;lt;EmpID=p({$&amp;lt;Year={'$(=To)'}&amp;gt;})&amp;gt;}&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;EmpID)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 21:52:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412906#M484063</guid>
      <dc:creator>RedSky001</dc:creator>
      <dc:date>2013-05-28T21:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis, count distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412907#M484064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mark for your reply.The below expression worked for me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count( distinct aggr( if( count({&amp;lt;EmpYear = {"&amp;gt;=$(FromPeriod)&amp;lt;=$(ToPeriod)"}&amp;gt;}distinct EmpYear) = 2, PERNR),PERNR,CareerProg))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 21:58:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-count-distinct/m-p/412907#M484064</guid>
      <dc:creator />
      <dc:date>2013-05-28T21:58:23Z</dc:date>
    </item>
  </channel>
</rss>

