<?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 Load 3 years data per sales person in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Load-3-years-data-per-sales-person/m-p/1815075#M66670</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a requirement that load only the latest&amp;nbsp; 3 yeas data per Salesperson from source. I am looking for the easiest way to achieve this.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sourcedata:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load * Inline [SalesPerson,Year,Sales&lt;/P&gt;&lt;P&gt;Eric,2012,5000&lt;/P&gt;&lt;P&gt;Eric,2014,7000&lt;/P&gt;&lt;P&gt;Eric,2019,8000&lt;/P&gt;&lt;P&gt;Eric,2021,5000&lt;/P&gt;&lt;P&gt;frank,2014,12000&lt;/P&gt;&lt;P&gt;frank,2012,6500&lt;/P&gt;&lt;P&gt;Natalie,2019,2000&lt;/P&gt;&lt;P&gt;Natalie,2020,2500&lt;/P&gt;&lt;P&gt;Natalie,2021,3500&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expected Output&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Eric,2014,7000&lt;/P&gt;&lt;P&gt;Eric,2019,8000&lt;/P&gt;&lt;P&gt;Eric,2021,5000&lt;/P&gt;&lt;P&gt;frank,2014,12000&lt;/P&gt;&lt;P&gt;frank,2012,6500&lt;/P&gt;&lt;P&gt;Natalie,2019,2000&lt;/P&gt;&lt;P&gt;Natalie,2020,2500&lt;/P&gt;&lt;P&gt;Natalie,2021,3500&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Nov 2021 18:17:33 GMT</pubDate>
    <dc:creator>ericdelaqua</dc:creator>
    <dc:date>2021-11-30T18:17:33Z</dc:date>
    <item>
      <title>Load 3 years data per sales person</title>
      <link>https://community.qlik.com/t5/App-Development/Load-3-years-data-per-sales-person/m-p/1815075#M66670</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a requirement that load only the latest&amp;nbsp; 3 yeas data per Salesperson from source. I am looking for the easiest way to achieve this.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sourcedata:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Load * Inline [SalesPerson,Year,Sales&lt;/P&gt;&lt;P&gt;Eric,2012,5000&lt;/P&gt;&lt;P&gt;Eric,2014,7000&lt;/P&gt;&lt;P&gt;Eric,2019,8000&lt;/P&gt;&lt;P&gt;Eric,2021,5000&lt;/P&gt;&lt;P&gt;frank,2014,12000&lt;/P&gt;&lt;P&gt;frank,2012,6500&lt;/P&gt;&lt;P&gt;Natalie,2019,2000&lt;/P&gt;&lt;P&gt;Natalie,2020,2500&lt;/P&gt;&lt;P&gt;Natalie,2021,3500&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Expected Output&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Eric,2014,7000&lt;/P&gt;&lt;P&gt;Eric,2019,8000&lt;/P&gt;&lt;P&gt;Eric,2021,5000&lt;/P&gt;&lt;P&gt;frank,2014,12000&lt;/P&gt;&lt;P&gt;frank,2012,6500&lt;/P&gt;&lt;P&gt;Natalie,2019,2000&lt;/P&gt;&lt;P&gt;Natalie,2020,2500&lt;/P&gt;&lt;P&gt;Natalie,2021,3500&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 18:17:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-3-years-data-per-sales-person/m-p/1815075#M66670</guid>
      <dc:creator>ericdelaqua</dc:creator>
      <dc:date>2021-11-30T18:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Load 3 years data per sales person</title>
      <link>https://community.qlik.com/t5/App-Development/Load-3-years-data-per-sales-person/m-p/1815084#M66671</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/13016"&gt;@ericdelaqua&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can solve this using &lt;A title="IntervalMatch" href="https://help.qlik.com/en-US/sense/February2021/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/IntervalMatch.htm" target="_blank" rel="noopener"&gt;intervalmatch()&lt;/A&gt;&amp;nbsp;and the two parameter &lt;A title="Max - chart function" href="https://help.qlik.com/en-US/sense/February2021/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/BasicAggregationFunctions/max.htm" target="_self"&gt;Max()&lt;/A&gt; function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data:
Load * 
Inline [
	SalesPerson,Year,Sales
	Eric,2012,5000
	Eric,2014,7000
	Eric,2019,8000
	Eric,2021,5000
	frank,2014,12000
	frank,2012,6500
	Natalie,2019,2000
	Natalie,2020,2500
	Natalie,2021,3500
	];

inner join (Data)
IntervalMatch (Year,SalesPerson)
Load 
	alt(Max(Year,3),min(Year)) as Min,
	Max(Year,1) as Max,
	SalesPerson
Resident Data
group by SalesPerson

;
Drop field Min, Max;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Vegar&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 06:31:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-3-years-data-per-sales-person/m-p/1815084#M66671</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2021-06-15T06:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Load 3 years data per sales person</title>
      <link>https://community.qlik.com/t5/App-Development/Load-3-years-data-per-sales-person/m-p/1815093#M66672</link>
      <description>&lt;P&gt;HI,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try the below one,&lt;/P&gt;&lt;P&gt;Test:&lt;BR /&gt;Load * Inline [SalesPerson,Year,Sales&lt;/P&gt;&lt;P&gt;Eric,2012,5000&lt;/P&gt;&lt;P&gt;Eric,2014,7000&lt;/P&gt;&lt;P&gt;Eric,2019,8000&lt;/P&gt;&lt;P&gt;Eric,2021,5000&lt;/P&gt;&lt;P&gt;frank,2014,12000&lt;/P&gt;&lt;P&gt;frank,2012,6500&lt;/P&gt;&lt;P&gt;Natalie,2019,2000&lt;/P&gt;&lt;P&gt;Natalie,2020,2500&lt;/P&gt;&lt;P&gt;Natalie,2021,3500&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;TEMP:&lt;BR /&gt;load SalesPerson,Year,Sales,&lt;BR /&gt;if(Peek(SalesPerson)=SalesPerson,Peek(row)+1,1) as row&lt;BR /&gt;Resident Test order by SalesPerson, Year desc;&lt;/P&gt;&lt;P&gt;FINAL:&lt;BR /&gt;Load SalesPerson ,Year,Sales Resident TEMP where row&amp;lt;=3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Drop Table Test,TEMP;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 06:48:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-3-years-data-per-sales-person/m-p/1815093#M66672</guid>
      <dc:creator>sasikanth</dc:creator>
      <dc:date>2021-06-15T06:48:34Z</dc:date>
    </item>
  </channel>
</rss>

