<?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: Set analysis help Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728171#M723798</link>
    <description>&lt;P&gt;Resigned and New are captured in this code.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SET DateFormat='YYYY-MM-DD';

tab1:
LOAD * INLINE [
    AsOfDate, EmployeeID, TeamCode, Region, Department, Team
    2020-05-31, 1111, 012C, South, Retail A, Digital A
    2020-05-31, 2222, 132V, North, Retail B, Digital B
    2020-06-30, 2222, 472H, East, Retail C, Digital C
    2020-06-30, 3333, 475U, East, Retail C, Digital F
    2020-06-30, 4444, 413N, West, Retail D, Digital G
    2020-07-31, 2222, 763I, West, Retail D, Digital H
    2020-07-31, 5555, 472H, North, Retail B, Digital C
    2020-07-31, 4444, 445B, West, Retail D, Digital E
];

Left Join(tab1)
LOAD Date(Max(AsOfDate)) As CurrMonth, Date(Max(AsOfDate,2)) As PrevMonth
Resident tab1
;
Let vCurrMonth=Peek('CurrMonth');
Let vPrevMonth=Peek('PrevMonth');

Left Join(tab1)
LOAD EmployeeID, 
	 Min(AsOfDate='$(vCurrMonth)') As F3, Min(AsOfDate='$(vPrevMonth)') As F4
Resident tab1
Where Match(AsOfDate,'$(vCurrMonth)','$(vPrevMonth)')
Group By EmployeeID
;
Left Join(tab1)
LOAD *, If(F3&amp;lt;F4, 'New',If(F3&amp;gt;F4, 'Resigned')) As Status
Resident tab1;&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 15 Jul 2020 19:19:34 GMT</pubDate>
    <dc:creator>Saravanan_Desingh</dc:creator>
    <dc:date>2020-07-15T19:19:34Z</dc:date>
    <item>
      <title>Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1727852#M723793</link>
      <description>&lt;TABLE border="1" width="76.95121951219512%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="14.467697354433072%" height="25px"&gt;AsOfDate&lt;/TD&gt;&lt;TD width="9.678644108981564%" height="25px"&gt;EmployeeID&lt;/TD&gt;&lt;TD width="13.048780487804878%" height="25px"&gt;TeamCode&lt;/TD&gt;&lt;TD width="13.414634146341463%" height="25px"&gt;Region&lt;/TD&gt;&lt;TD width="12.073170731707316%" height="25px"&gt;Department&lt;/TD&gt;&lt;TD width="14.26829268292683%" height="25px"&gt;Team&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.467697354433072%" height="47px"&gt;2020-05-31&lt;/TD&gt;&lt;TD width="9.678644108981564%" height="47px"&gt;1111&lt;/TD&gt;&lt;TD width="13.048780487804878%" height="47px"&gt;012C&lt;/TD&gt;&lt;TD width="13.414634146341463%" height="47px"&gt;South&lt;/TD&gt;&lt;TD width="12.073170731707316%" height="47px"&gt;Retail A&lt;/TD&gt;&lt;TD width="14.26829268292683%" height="47px"&gt;Digital A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.467697354433072%" height="25px"&gt;2020-05-31&lt;/TD&gt;&lt;TD width="9.678644108981564%" height="25px"&gt;2222&lt;/TD&gt;&lt;TD width="13.048780487804878%" height="25px"&gt;132V&lt;/TD&gt;&lt;TD width="13.414634146341463%" height="25px"&gt;North&lt;/TD&gt;&lt;TD width="12.073170731707316%" height="25px"&gt;Retail B&lt;/TD&gt;&lt;TD width="14.26829268292683%" height="25px"&gt;Digital B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.467697354433072%" height="25px"&gt;2020-06-30&lt;/TD&gt;&lt;TD width="9.678644108981564%" height="25px"&gt;2222&lt;/TD&gt;&lt;TD width="13.048780487804878%" height="25px"&gt;472H&lt;/TD&gt;&lt;TD width="13.414634146341463%" height="25px"&gt;East&lt;/TD&gt;&lt;TD width="12.073170731707316%" height="25px"&gt;Retail C&lt;/TD&gt;&lt;TD width="14.26829268292683%" height="25px"&gt;Digital C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.467697354433072%" height="25px"&gt;2020-06-30&lt;/TD&gt;&lt;TD width="9.678644108981564%" height="25px"&gt;3333&lt;/TD&gt;&lt;TD width="13.048780487804878%" height="25px"&gt;475U&lt;/TD&gt;&lt;TD width="13.414634146341463%" height="25px"&gt;East&lt;/TD&gt;&lt;TD width="12.073170731707316%" height="25px"&gt;Retail C&lt;/TD&gt;&lt;TD width="14.26829268292683%" height="25px"&gt;Digital F&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.467697354433072%" height="25px"&gt;2020-06-30&lt;/TD&gt;&lt;TD width="9.678644108981564%" height="25px"&gt;4444&lt;/TD&gt;&lt;TD width="13.048780487804878%" height="25px"&gt;413N&lt;/TD&gt;&lt;TD width="13.414634146341463%" height="25px"&gt;West&lt;/TD&gt;&lt;TD width="12.073170731707316%" height="25px"&gt;Retail D&lt;/TD&gt;&lt;TD width="14.26829268292683%" height="25px"&gt;Digital G&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.467697354433072%" height="25px"&gt;2020-07-31&lt;/TD&gt;&lt;TD width="9.678644108981564%" height="25px"&gt;2222&lt;/TD&gt;&lt;TD width="13.048780487804878%" height="25px"&gt;763I&lt;/TD&gt;&lt;TD width="13.414634146341463%" height="25px"&gt;East&lt;/TD&gt;&lt;TD width="12.073170731707316%" height="25px"&gt;Retail D&lt;/TD&gt;&lt;TD width="14.26829268292683%" height="25px"&gt;Digital H&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.467697354433072%" height="25px"&gt;2020-07-31&lt;/TD&gt;&lt;TD width="9.678644108981564%" height="25px"&gt;5555&lt;/TD&gt;&lt;TD width="13.048780487804878%" height="25px"&gt;472H&lt;/TD&gt;&lt;TD width="13.414634146341463%" height="25px"&gt;East&lt;/TD&gt;&lt;TD width="12.073170731707316%" height="25px"&gt;Retail C&lt;/TD&gt;&lt;TD width="14.26829268292683%" height="25px"&gt;Digital C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.467697354433072%" height="25px"&gt;2020-07-30&lt;/TD&gt;&lt;TD width="9.678644108981564%" height="25px"&gt;4444&lt;/TD&gt;&lt;TD width="13.048780487804878%" height="25px"&gt;472H&lt;/TD&gt;&lt;TD width="13.414634146341463%" height="25px"&gt;East&lt;/TD&gt;&lt;TD width="12.073170731707316%" height="25px"&gt;Retail C&lt;/TD&gt;&lt;TD width="14.26829268292683%" height="25px"&gt;Digital C&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the employee data, i want create headcount analysis.&lt;/P&gt;&lt;P&gt;I cannot do anything in the script. All data will just get appended anymonth.&lt;/P&gt;&lt;P&gt;User will select 2 months for comparison and&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;They want get&amp;nbsp; New to the company, Retained , Resigned from the company, Internal transfer&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;this should be valid based on selection of Region, Department and Team&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So when i compare June and July Month i&amp;nbsp; select&amp;nbsp; only Team (Digital C ), I should get output&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;New to Bank: 1 (Employee 5555)&lt;/P&gt;&lt;P&gt;Resigned from Bank: 0&lt;/P&gt;&lt;P&gt;Internal Transfer: + 1 (Employee 4444)&lt;/P&gt;&lt;P&gt;Internal Transfer: -1(Employee 2222)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So when i compare June and July Month i&amp;nbsp; select only Region (East) , I should get output&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;New to Bank: 1 (Employee 5555)&lt;BR /&gt;Resigned from Bank: 1 (Employee 3333)&lt;BR /&gt;Internal Transfer: +1 ( Employee 4444 )&lt;BR /&gt;Internal Transfer: -0&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; Any two months can be selected for comparison, Jan Mar, Jan Nov, Feb Apr, June Nov, etc&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hint:&lt;/STRONG&gt; Lowest grain is Team Code, If team code of employee is present and not present in last month , he is new to the bank,&lt;BR /&gt;if team code of employee is not present this month but present in last month, his has resigned&lt;/P&gt;&lt;P&gt;if team code is present for both month but different and it is same as filter selection, +ve internal transfer,&lt;/P&gt;&lt;P&gt;if team code is present for both month but different and it is&amp;nbsp; not same as filter selection, -ve internal transfer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a composite key of EmployeeID,Teamcode at the backend if useful&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:22:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1727852#M723793</guid>
      <dc:creator>saumyashah90</dc:creator>
      <dc:date>2024-11-16T18:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1727861#M723794</link>
      <description>&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;1111 - Why it is not been considered as Resigned?&lt;/P&gt;&lt;P&gt;2222 - TeamCode and Team are different. How you say it is +ve internal transfer&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 02:59:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1727861#M723794</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-15T02:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1727862#M723795</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Question -&amp;gt;1111 - Why it is not been considered as Resigned? :&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Reply-&amp;gt;&lt;/P&gt;&lt;P&gt;Because i have taken June July are comparing month.&lt;BR /&gt;At a time two months will be there for comparison.&lt;BR /&gt;&lt;BR /&gt;If we would have compared May June or May July, 1111 would be resigned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question-&amp;gt;&lt;SPAN&gt;2222 - TeamCode and Team are different. How you say it is +ve internal transfer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1st condition - he should not be totaly new to company, he/she should have some Teamcode tagged in previous month.&lt;/P&gt;&lt;P&gt;2nd condition - Team code should be different comparing two month&lt;/P&gt;&lt;P&gt;3rd condition - which ever teamcode and its related team is selected , if&amp;nbsp; team code of current(higher month) is same its +ve transfer&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 03:32:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1727862#M723795</guid>
      <dc:creator>saumyashah90</dc:creator>
      <dc:date>2020-07-15T03:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728057#M723796</link>
      <description>&lt;P&gt;I am still not clear.&lt;/P&gt;&lt;P&gt;2222:&lt;BR /&gt;2020-05-31 2222 132V North Retail B Digital B&lt;BR /&gt;2020-06-30 2222 472H East Retail C Digital C&lt;BR /&gt;2020-07-31 2222 763I West Retail D Digital H&lt;BR /&gt;4444:&lt;BR /&gt;2020-06-30 4444 413N West Retail D Digital G&lt;BR /&gt;2020-07-30 4444 445B West Retail D Digital E&lt;/P&gt;&lt;P&gt;With the above sample, please tell me where you are seeing as same team and which one is not?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 13:39:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728057#M723796</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-15T13:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728111#M723797</link>
      <description>&lt;P&gt;I am also not clear on Internal transfers, but the first two could be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;='New to Bank: ' &amp;amp;
Count(DISTINCT {&amp;lt;EmployeeID = P({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;})*e({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;}), Team&amp;gt;} EmployeeID)
&amp;amp; '(' &amp;amp;
Concat(DISTINCT {&amp;lt;EmployeeID = P({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;})*e({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;}), Team&amp;gt;} EmployeeID, ',')
&amp;amp;')'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;='Resigned: ' &amp;amp;
Count(DISTINCT {&amp;lt;EmployeeID = e({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;})*p({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;}), Team&amp;gt;} EmployeeID)
&amp;amp; '(' &amp;amp;
Concat(DISTINCT {&amp;lt;EmployeeID = e({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;})*p({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;}), Team&amp;gt;} EmployeeID, ',')
&amp;amp;')'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 15:42:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728111#M723797</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-07-15T15:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728171#M723798</link>
      <description>&lt;P&gt;Resigned and New are captured in this code.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SET DateFormat='YYYY-MM-DD';

tab1:
LOAD * INLINE [
    AsOfDate, EmployeeID, TeamCode, Region, Department, Team
    2020-05-31, 1111, 012C, South, Retail A, Digital A
    2020-05-31, 2222, 132V, North, Retail B, Digital B
    2020-06-30, 2222, 472H, East, Retail C, Digital C
    2020-06-30, 3333, 475U, East, Retail C, Digital F
    2020-06-30, 4444, 413N, West, Retail D, Digital G
    2020-07-31, 2222, 763I, West, Retail D, Digital H
    2020-07-31, 5555, 472H, North, Retail B, Digital C
    2020-07-31, 4444, 445B, West, Retail D, Digital E
];

Left Join(tab1)
LOAD Date(Max(AsOfDate)) As CurrMonth, Date(Max(AsOfDate,2)) As PrevMonth
Resident tab1
;
Let vCurrMonth=Peek('CurrMonth');
Let vPrevMonth=Peek('PrevMonth');

Left Join(tab1)
LOAD EmployeeID, 
	 Min(AsOfDate='$(vCurrMonth)') As F3, Min(AsOfDate='$(vPrevMonth)') As F4
Resident tab1
Where Match(AsOfDate,'$(vCurrMonth)','$(vPrevMonth)')
Group By EmployeeID
;
Left Join(tab1)
LOAD *, If(F3&amp;lt;F4, 'New',If(F3&amp;gt;F4, 'Resigned')) As Status
Resident tab1;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Jul 2020 19:19:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728171#M723798</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-15T19:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728174#M723799</link>
      <description>&lt;P&gt;Output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV45.PNG" style="width: 384px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37485iB3F685543365DB66/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV45.PNG" alt="commQV45.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 19:21:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728174#M723799</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-15T19:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728177#M723800</link>
      <description>&lt;P&gt;If I understand on the Internal Transfer logic,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SET DateFormat='YYYY-MM-DD';

tab1:
LOAD * INLINE [
    AsOfDate, EmployeeID, TeamCode, Region, Department, Team
    2020-05-31, 1111, 012C, South, Retail A, Digital A
    2020-05-31, 2222, 132V, North, Retail B, Digital B
    2020-06-30, 2222, 472H, East, Retail C, Digital C
    2020-06-30, 3333, 475U, East, Retail C, Digital F
    2020-06-30, 4444, 413N, West, Retail D, Digital G
    2020-07-31, 2222, 763I, West, Retail D, Digital H
    2020-07-31, 5555, 472H, North, Retail B, Digital C
    2020-07-31, 4444, 445B, West, Retail D, Digital E
];

Left Join(tab1)
LOAD Date(Max(AsOfDate)) As CurrMonth, Date(Max(AsOfDate,2)) As PrevMonth
Resident tab1
;
Let vCurrMonth=Peek('CurrMonth');
Let vPrevMonth=Peek('PrevMonth');

Left Join(tab1)
LOAD EmployeeID, Count(DISTINCT Department) As F1,
	 Min(AsOfDate='$(vCurrMonth)') As F3, Min(AsOfDate='$(vPrevMonth)') As F4
Resident tab1
Where Match(AsOfDate,'$(vCurrMonth)','$(vPrevMonth)')
Group By EmployeeID
;
Left Join(tab1)
LOAD *, If(F3&amp;lt;F4, 'New',If(F3&amp;gt;F4, 'Resigned', If(F1&amp;gt;1 And AsOfDate='$(vCurrMonth)','+ve Internal Transfer','-ve Internal Transfer'))) As Status
Resident tab1
Where Match(AsOfDate,'$(vCurrMonth)','$(vPrevMonth)');&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Jul 2020 19:37:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728177#M723800</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-15T19:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728182#M723801</link>
      <description>&lt;P&gt;A bug was fixed in this version.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SET DateFormat='YYYY-MM-DD';

tab1:
LOAD * INLINE [
    AsOfDate, EmployeeID, TeamCode, Region, Department, Team
    2020-05-31, 1111, 012C, South, Retail A, Digital A
    2020-05-31, 2222, 132V, North, Retail B, Digital B
    2020-06-30, 2222, 472H, East, Retail C, Digital C
    2020-06-30, 3333, 475U, East, Retail C, Digital F
    2020-06-30, 4444, 413N, West, Retail D, Digital G
    2020-07-31, 2222, 763I, West, Retail D, Digital H
    2020-07-31, 5555, 472H, North, Retail B, Digital C
    2020-07-31, 4444, 445B, West, Retail D, Digital E
];

Left Join(tab1)
LOAD Date(Max(AsOfDate)) As CurrMonth, Date(Max(AsOfDate,2)) As PrevMonth
Resident tab1
;
Let vCurrMonth=Peek('CurrMonth');
Let vPrevMonth=Peek('PrevMonth');

Left Join(tab1)
LOAD EmployeeID, Count(DISTINCT Department) As F1,
	 Min(AsOfDate='$(vCurrMonth)') As F3, Min(AsOfDate='$(vPrevMonth)') As F4
Resident tab1
Where Match(AsOfDate,'$(vCurrMonth)','$(vPrevMonth)')
Group By EmployeeID
;
Left Join(tab1)
LOAD *, If(F3&amp;lt;F4, 'New',If(F3&amp;gt;F4, 'Resigned', If(AsOfDate='$(vCurrMonth)',If(F1&amp;gt;1,'+ve Internal Transfer','-ve Internal Transfer')))) As Status
Resident tab1
Where Match(AsOfDate,'$(vCurrMonth)','$(vPrevMonth)');&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Jul 2020 19:49:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728182#M723801</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-15T19:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728185#M723802</link>
      <description>&lt;P&gt;Output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV46.PNG" style="width: 437px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37486i42029DDF4D2F3932/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV46.PNG" alt="commQV46.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 19:50:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728185#M723802</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-15T19:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728226#M723803</link>
      <description>&lt;P&gt;&lt;SPAN&gt;2222:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2020-05-31 2222 132V North Retail B Digital B&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2020-06-30 2222 472H East Retail C Digital C&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2020-07-31 2222 763I West Retail D Digital H&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4444:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2020-06-30 4444 413N West Retail D Digital G&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2020-07-30 4444 472H East Retail C Digital C&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let me change some value so that everyone is clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It always depends on which two months you select for comparison.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Lets say we are selecting Jun and July for comparison and Higher month is July(2020-07-30)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;so when there is a selection of Team Digital C&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We should have 2222 as -ve internal transfer( No more in group C but still with the bank in other team)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We should have 4444 as +ve internal transfer( Was added in group C&amp;nbsp; and was still present in bank with other team last/lower month)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I hope this would help&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 01:16:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728226#M723803</guid>
      <dc:creator>saumyashah90</dc:creator>
      <dc:date>2020-07-16T01:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728227#M723804</link>
      <description>&lt;P&gt;2222:&lt;BR /&gt;2020-05-31 2222 132V North Retail B Digital B&lt;BR /&gt;2020-06-30 2222 472H East Retail C Digital C&lt;BR /&gt;2020-07-31 2222 763I West Retail D Digital H&lt;BR /&gt;4444:&lt;BR /&gt;2020-06-30 4444 413N West Retail D Digital G&lt;BR /&gt;2020-07-30 4444 472H East Retail C Digital C&lt;/P&gt;&lt;P&gt;Let me change some value so that everyone is clear&lt;BR /&gt;It always depends on which two months you select for comparison.&amp;nbsp;&lt;BR /&gt;Lets say we are selecting Jun and July for comparison and Higher month is July(2020-07-30)&lt;BR /&gt;so when there is a selection of Team Digital C&lt;/P&gt;&lt;P&gt;We should have 2222 as -ve internal transfer( No more in group C but still with the bank in other team)&lt;BR /&gt;and&amp;nbsp;&lt;BR /&gt;We should have 4444 as +ve internal transfer( Was added in group C&amp;nbsp; and was still present in bank with other team last/lower month)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 01:16:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728227#M723804</guid>
      <dc:creator>saumyashah90</dc:creator>
      <dc:date>2020-07-16T01:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728228#M723805</link>
      <description>&lt;P&gt;I dont have flexibility to do any changes at the backend.&lt;/P&gt;&lt;P&gt;Data will get appended every month and month comparison will not always be current and previous.&lt;/P&gt;&lt;P&gt;It could be Jan April, Feb Mar, Mar Nov, etc&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 01:18:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728228#M723805</guid>
      <dc:creator>saumyashah90</dc:creator>
      <dc:date>2020-07-16T01:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728232#M723806</link>
      <description>&lt;P&gt;Also i saw the application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not getting correct resigned and new bank also?&lt;/P&gt;&lt;P&gt;Also i should have two months to select flexibility for the comparison.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 01:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728232#M723806</guid>
      <dc:creator>saumyashah90</dc:creator>
      <dc:date>2020-07-16T01:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728340#M723807</link>
      <description>&lt;P&gt;Any help people?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 09:43:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728340#M723807</guid>
      <dc:creator>saumyashah90</dc:creator>
      <dc:date>2020-07-16T09:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728397#M723808</link>
      <description>&lt;P&gt;I don't see any issues with New to Bank and Resigned once you select 2 months&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 538px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37526i80F862983D5837EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I guess you intial input didn't match with the output you were expecting, but with the change of data it does... try out these two expression for Internal Transfers&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;='Internal Transfer: +' &amp;amp;
Sum(DISTINCT {&amp;lt;EmployeeID = p({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;})*p({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;}), Team&amp;gt;} Aggr(
	If(Team = Only({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;} AsOfMonthYear))"}&amp;gt;} Team), 1, 0), EmployeeID, Team))
&amp;amp; '(' &amp;amp;
Concat(DISTINCT {&amp;lt;EmployeeID = p({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;})*p({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;}), Team&amp;gt;} Aggr(
	If(Team = Only({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;} AsOfMonthYear))"}&amp;gt;} Team), EmployeeID), EmployeeID, Team), ',')
&amp;amp;')'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;='Internal Transfer: -' &amp;amp;
Sum(DISTINCT {&amp;lt;EmployeeID = p({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;})*p({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;}), Team&amp;gt;} Aggr(
	If(Only({&amp;lt;EmployeeID = p({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;})*p({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;}), Team&amp;gt;} Team) = Only({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;} AsOfMonthYear))"}&amp;gt;} Team), 1, 0), EmployeeID, Team))
&amp;amp; '(' &amp;amp;
Concat(DISTINCT {&amp;lt;EmployeeID = p({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;})*p({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;}), Team&amp;gt;} Aggr(
	If(Team = Only({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;} AsOfMonthYear))"}&amp;gt;} Team), EmployeeID), EmployeeID, Team), ',')
&amp;amp;')'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 859px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37527i5DB12E5A04289177/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 11:25:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728397#M723808</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-07-16T11:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728689#M723809</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;When you click Digital C, we should not be getting 3333 in resigned.&lt;/P&gt;&lt;P&gt;Because 3333 was never a part of Digital C in June .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your answer would be correct if there is no Digital C selected. Basically all should be based on selection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saumyashah90_1-1594961459467.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37596i5136193714771E29/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saumyashah90_1-1594961459467.png" alt="saumyashah90_1-1594961459467.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 06:23:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728689#M723809</guid>
      <dc:creator>saumyashah90</dc:creator>
      <dc:date>2020-07-17T06:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728803#M723810</link>
      <description>&lt;P&gt;Check now&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37636i6EFDD496F42436BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 11:27:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1728803#M723810</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-07-17T11:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1729730#M723811</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For internal transfer,&amp;nbsp; when i keep sum part, i get value, but as soon as i add concat part(bold) nothing appears in my text box&lt;/P&gt;&lt;P&gt;='Internal Transfer: +' &amp;amp;&lt;BR /&gt;Sum(DISTINCT {&amp;lt;EmployeeID = p({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;})*p({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;}), Team&amp;gt;} Aggr(&lt;BR /&gt;If(Team = Only({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;} AsOfMonthYear))"}&amp;gt;} Team), 1, 0), EmployeeID, Team))&lt;BR /&gt;&lt;STRONG&gt;&amp;amp; '(' &amp;amp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Concat(DISTINCT {&amp;lt;EmployeeID = p({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;})*p({&amp;lt;AsOfMonthYear = {"$(=Min({&amp;lt;Team&amp;gt;}AsOfMonthYear))"}, Team&amp;gt;}), Team&amp;gt;} Aggr(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;If(Team = Only({&amp;lt;AsOfMonthYear = {"$(=Max({&amp;lt;Team&amp;gt;} AsOfMonthYear))"}&amp;gt;} Team), EmployeeID), EmployeeID, Team), ',')&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;amp;')'&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 01:33:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1729730#M723811</guid>
      <dc:creator>saumyashah90</dc:creator>
      <dc:date>2020-07-22T01:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis help Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1731310#M723812</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i select Retail C only. I get 4444 in new to bank, where as it should be internal transfer.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="saumyashah90_0-1595931713972.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/38167iE5240FB297A81680/image-size/medium?v=v2&amp;amp;px=400" role="button" title="saumyashah90_0-1595931713972.png" alt="saumyashah90_0-1595931713972.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 10:22:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-help-Expression/m-p/1731310#M723812</guid>
      <dc:creator>saumyashah90</dc:creator>
      <dc:date>2020-07-28T10:22:07Z</dc:date>
    </item>
  </channel>
</rss>

