<?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 Loading multiple years of data and getting duplicates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loading-multiple-years-of-data-and-getting-duplicates/m-p/1763736#M454156</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to load two different xml files with the same fields. When I load one it works fine, but when I load the second one it is giving me duplicates. One file is 2021 detail and the other file is 2020 detail. For instance there are two 2018 years but I want to combine them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;set v_FY_counter = 1;&lt;BR /&gt;do while v_FY_counter &amp;lt; 8&lt;BR /&gt;Load&lt;/P&gt;&lt;P&gt;[BudgetYear]&amp;amp;'--'&amp;amp;[BudgetCycle]&amp;amp;'--'&amp;amp;[ServiceAgencyName]&amp;amp;'--'&amp;amp;[SubmissionDate]&amp;amp;'--'&amp;amp;[ProgramElementNumber] AS [Program Element ID],&lt;BR /&gt;[BudgetYear] + ($(v_FY_counter) - 3) as [PEC Funding Year],&lt;BR /&gt;if($(v_FY_counter) = 1,[ProgramElementFunding/PriorYear],&lt;BR /&gt;if($(v_FY_counter) = 2,[ProgramElementFunding/CurrentYear],&lt;BR /&gt;if($(v_FY_counter) = 3,[ProgramElementFunding/BudgetYearOneOCO],&lt;BR /&gt;if($(v_FY_counter) = 4,[ProgramElementFunding/BudgetYearTwo],&lt;BR /&gt;if($(v_FY_counter) = 5,[ProgramElementFunding/BudgetYearThree],&lt;BR /&gt;if($(v_FY_counter) = 6,[ProgramElementFunding/BudgetYearFour],&lt;BR /&gt;if($(v_FY_counter) = 7,[ProgramElementFunding/BudgetYearFive],&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;null()))))))) as [PEC Funding Amount]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;FROM [lib://2021.xml]&lt;BR /&gt;(XmlSimple, table is [MasterJustificationBook]);&lt;BR /&gt;Let v_FY_counter = v_FY_counter + 1;&lt;BR /&gt;// exit script;&lt;BR /&gt;Loop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set v_FY_counter = 1;&lt;BR /&gt;do while v_FY_counter &amp;lt; 8&lt;BR /&gt;Load&lt;/P&gt;&lt;P&gt;[BudgetYear]&amp;amp;'--'&amp;amp;[BudgetCycle]&amp;amp;'--'&amp;amp;[ServiceAgencyName]&amp;amp;'--'&amp;amp;[SubmissionDate]&amp;amp;'--'&amp;amp;[ProgramElementNumber] AS [Program Element ID],&lt;BR /&gt;[BudgetYear] + ($(v_FY_counter) - 3) as [PEC Funding Year],&lt;BR /&gt;&lt;BR /&gt;if($(v_FY_counter) = 1,[ProgramElementFunding/PriorYear],&lt;BR /&gt;if($(v_FY_counter) = 2,[ProgramElementFunding/CurrentYear],&lt;BR /&gt;if($(v_FY_counter) = 3,[ProgramElementFunding/BudgetYearOneOCO],&lt;BR /&gt;if($(v_FY_counter) = 4,[ProgramElementFunding/BudgetYearTwo],&lt;BR /&gt;if($(v_FY_counter) = 5,[ProgramElementFunding/BudgetYearThree],&lt;BR /&gt;if($(v_FY_counter) = 6,[ProgramElementFunding/BudgetYearFour],&lt;BR /&gt;if($(v_FY_counter) = 7,[ProgramElementFunding/BudgetYearFive],&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;null()))))))) as [PEC Funding Amount]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;FROM [lib://020.xml]&lt;BR /&gt;(XmlSimple, table is [MasterJustificationBook/]);&lt;BR /&gt;Let v_FY_counter = v_FY_counter + 1;&lt;BR /&gt;// exit script;&lt;BR /&gt;Loop&lt;/P&gt;</description>
    <pubDate>Mon, 23 Nov 2020 14:09:10 GMT</pubDate>
    <dc:creator>heathqm</dc:creator>
    <dc:date>2020-11-23T14:09:10Z</dc:date>
    <item>
      <title>Loading multiple years of data and getting duplicates</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-multiple-years-of-data-and-getting-duplicates/m-p/1763736#M454156</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to load two different xml files with the same fields. When I load one it works fine, but when I load the second one it is giving me duplicates. One file is 2021 detail and the other file is 2020 detail. For instance there are two 2018 years but I want to combine them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;set v_FY_counter = 1;&lt;BR /&gt;do while v_FY_counter &amp;lt; 8&lt;BR /&gt;Load&lt;/P&gt;&lt;P&gt;[BudgetYear]&amp;amp;'--'&amp;amp;[BudgetCycle]&amp;amp;'--'&amp;amp;[ServiceAgencyName]&amp;amp;'--'&amp;amp;[SubmissionDate]&amp;amp;'--'&amp;amp;[ProgramElementNumber] AS [Program Element ID],&lt;BR /&gt;[BudgetYear] + ($(v_FY_counter) - 3) as [PEC Funding Year],&lt;BR /&gt;if($(v_FY_counter) = 1,[ProgramElementFunding/PriorYear],&lt;BR /&gt;if($(v_FY_counter) = 2,[ProgramElementFunding/CurrentYear],&lt;BR /&gt;if($(v_FY_counter) = 3,[ProgramElementFunding/BudgetYearOneOCO],&lt;BR /&gt;if($(v_FY_counter) = 4,[ProgramElementFunding/BudgetYearTwo],&lt;BR /&gt;if($(v_FY_counter) = 5,[ProgramElementFunding/BudgetYearThree],&lt;BR /&gt;if($(v_FY_counter) = 6,[ProgramElementFunding/BudgetYearFour],&lt;BR /&gt;if($(v_FY_counter) = 7,[ProgramElementFunding/BudgetYearFive],&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;null()))))))) as [PEC Funding Amount]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;FROM [lib://2021.xml]&lt;BR /&gt;(XmlSimple, table is [MasterJustificationBook]);&lt;BR /&gt;Let v_FY_counter = v_FY_counter + 1;&lt;BR /&gt;// exit script;&lt;BR /&gt;Loop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set v_FY_counter = 1;&lt;BR /&gt;do while v_FY_counter &amp;lt; 8&lt;BR /&gt;Load&lt;/P&gt;&lt;P&gt;[BudgetYear]&amp;amp;'--'&amp;amp;[BudgetCycle]&amp;amp;'--'&amp;amp;[ServiceAgencyName]&amp;amp;'--'&amp;amp;[SubmissionDate]&amp;amp;'--'&amp;amp;[ProgramElementNumber] AS [Program Element ID],&lt;BR /&gt;[BudgetYear] + ($(v_FY_counter) - 3) as [PEC Funding Year],&lt;BR /&gt;&lt;BR /&gt;if($(v_FY_counter) = 1,[ProgramElementFunding/PriorYear],&lt;BR /&gt;if($(v_FY_counter) = 2,[ProgramElementFunding/CurrentYear],&lt;BR /&gt;if($(v_FY_counter) = 3,[ProgramElementFunding/BudgetYearOneOCO],&lt;BR /&gt;if($(v_FY_counter) = 4,[ProgramElementFunding/BudgetYearTwo],&lt;BR /&gt;if($(v_FY_counter) = 5,[ProgramElementFunding/BudgetYearThree],&lt;BR /&gt;if($(v_FY_counter) = 6,[ProgramElementFunding/BudgetYearFour],&lt;BR /&gt;if($(v_FY_counter) = 7,[ProgramElementFunding/BudgetYearFive],&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;null()))))))) as [PEC Funding Amount]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;FROM [lib://020.xml]&lt;BR /&gt;(XmlSimple, table is [MasterJustificationBook/]);&lt;BR /&gt;Let v_FY_counter = v_FY_counter + 1;&lt;BR /&gt;// exit script;&lt;BR /&gt;Loop&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 14:09:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-multiple-years-of-data-and-getting-duplicates/m-p/1763736#M454156</guid>
      <dc:creator>heathqm</dc:creator>
      <dc:date>2020-11-23T14:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Loading multiple years of data and getting duplicates</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-multiple-years-of-data-and-getting-duplicates/m-p/1763818#M454164</link>
      <description>&lt;P&gt;can you provide sample data and point out what you perceive to be duplicates?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 19:00:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-multiple-years-of-data-and-getting-duplicates/m-p/1763818#M454164</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2020-11-23T19:00:15Z</dc:date>
    </item>
  </channel>
</rss>

