<?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: Back filled data causing duplication in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Back-filled-data-causing-duplication/m-p/1737031#M591897</link>
    <description>&lt;P&gt;Duplication was caused due to the connecting key being too generic.&amp;nbsp; Adding in a further identifier into this field has removed the duplication and corrected the issue&lt;/P&gt;</description>
    <pubDate>Wed, 19 Aug 2020 11:11:05 GMT</pubDate>
    <dc:creator>hartleyr</dc:creator>
    <dc:date>2020-08-19T11:11:05Z</dc:date>
    <item>
      <title>Back filled data causing duplication</title>
      <link>https://community.qlik.com/t5/QlikView/Back-filled-data-causing-duplication/m-p/1735542#M591896</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I'm hoping for some help with back filling data.&amp;nbsp; I have managed to get 99% of the way there, but I'm having an issue with duplication occurring which means the incorrect data is associated&lt;/P&gt;&lt;P&gt;I am pulling in data for our Electricity RAG banding.&amp;nbsp; Banding/Pricing is reviewed yearly, and for all but one of our areas it hasn't changed since 01/04/2018.&amp;nbsp; For the one that has changed, we have changes yearly - 01/04/18, 01/04/19 &amp;amp; 01/04/2020.&lt;/P&gt;&lt;P&gt;For those that haven't changed I get a full set of associated data from my script.&amp;nbsp; For the one that changes however, I have the correct associations to the 'set date' but it also associates the same dates to the 01/04/18 'set date' and I cant understand why - I'm assuming it'll be something simple in the script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any pointers would be greatly appreciated&lt;/P&gt;&lt;P&gt;The script I am using is as follows;&lt;/P&gt;&lt;P&gt;Price_Map:&lt;BR /&gt;Mapping load&lt;BR /&gt;Date(Floor(Date),'DD/MM/YYYY')&amp;amp;'_'&amp;amp;[MPAN Prefix]&amp;amp;'_'&amp;amp;RAG as %PriceKey,&lt;BR /&gt;[Price per kwh]&lt;BR /&gt;From $(vOutputPath)Electricity RAG Rates.qvd (qvd);&lt;/P&gt;&lt;P&gt;Pricing:&lt;BR /&gt;load&lt;BR /&gt;Date(Floor(Date),'DD/MM/YYYY')&amp;amp;'_1' as SetDate,&lt;BR /&gt;[MPAN Prefix],&lt;BR /&gt;interval(num#(Time,'0.00000000'),'hh:mm') as Time,&lt;BR /&gt;RAG,&lt;BR /&gt;applymap('Price_Map',Date(Floor(Date),'DD/MM/YYYY')&amp;amp;'_'&amp;amp;[MPAN Prefix]&amp;amp;'_'&amp;amp;RAG) as [Price per kWh]&lt;BR /&gt;from $(vOutputPath)Electricity RAGs WD.qvd (qvd);&lt;/P&gt;&lt;P&gt;concatenate&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;Date(Floor(Date),'DD/MM/YYYY')&amp;amp;'_0' as SetDate,&lt;BR /&gt;[MPAN Prefix],&lt;BR /&gt;interval(num#(Time,'0.00000000'),'hh:mm') as Time,&lt;BR /&gt;RAG,&lt;BR /&gt;applymap('Price_Map',Date(Floor(Date),'DD/MM/YYYY')&amp;amp;'_'&amp;amp;[MPAN Prefix]&amp;amp;'_'&amp;amp;RAG) as [Price per kWh]&lt;BR /&gt;from $(vOutputPath)Electricity RAGs WE.qvd (qvd);&lt;/P&gt;&lt;P&gt;Store * from Pricing into $(vOutputDest)Electricity RAG Pricing.qvd (qvd);&lt;BR /&gt;//Drop table Pricing;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for each vPrefix in 10,11,12,13,14,15,16,17,18,19,20,21,22,23&lt;/P&gt;&lt;P&gt;Transform:&lt;BR /&gt;load&lt;BR /&gt;distinct(Date(Floor(Date),'DD/MM/YYYY')) as IndexDate,&lt;BR /&gt;Date(Floor(Date),'DD/MM/YYYY') as SetDate&lt;BR /&gt;&lt;BR /&gt;from $(vOutputPath)Electricity RAGs WD.qvd (qvd)&lt;BR /&gt;where [MPAN Prefix] = $(vPrefix);&lt;BR /&gt;&lt;BR /&gt;if NoOfRows('Transform') &amp;gt;0 then&lt;BR /&gt;&lt;BR /&gt;concatenate&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;MinMaxDate:&lt;BR /&gt;Load Min (IndexDate) as MinDate&lt;BR /&gt;,Max(IndexDate) as MaxDate&lt;BR /&gt;&lt;BR /&gt;resident Transform&lt;BR /&gt;where not(isnull(IndexDate));&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Let vMinDate = Peek('MinDate',-1,'MinMaxDate') - 1;&lt;BR /&gt;Let vMaxDate = if(Peek('MaxDate',-1,'MinMaxDate')&amp;gt;=IndexDate, Peek('MaxDate',-1,'MinMaxDate'),Today());&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Join (Transform)&lt;BR /&gt;&lt;BR /&gt;Load Date(recno()+$(vMinDate)) as IndexDate Autogenerate vMaxDate - vMinDate;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;FillResults:&lt;BR /&gt;&lt;BR /&gt;concatenate Load&lt;BR /&gt;&lt;BR /&gt;if(isnull(IndexDate),peek(IndexDate),IndexDate) as IndexDate,&lt;BR /&gt;if(isnull(SetDate),peek(SetDate),SetDate) as SetDate,&lt;BR /&gt;if(isnull(weekday(IndexDate)),peek(weekday(IndexDate)),Weekday(IndexDate)) as day,&lt;BR /&gt;if(isnull(Networkdays(IndexDate,IndexDate)),peek(Networkdays(IndexDate,IndexDate)),Networkdays(IndexDate,IndexDate)) as daytype&lt;BR /&gt;&lt;BR /&gt;Resident Transform&lt;BR /&gt;Order By IndexDate;&lt;BR /&gt;&lt;BR /&gt;drop fields MinDate, MaxDate;&lt;BR /&gt;Store * From Transform into $(vOutputDest)Electricity Set Dates.qvd (qvd);&lt;BR /&gt;&lt;BR /&gt;drop table Transform;&lt;BR /&gt;elseif NoOfRows('Transform') =0; drop table 'Transform';&lt;BR /&gt;end if;&lt;/P&gt;&lt;P&gt;load IndexDate,&lt;BR /&gt;SetDate&amp;amp;'_'&amp;amp;daytype as SetDate&lt;BR /&gt;,day&lt;BR /&gt;from $(vOutputDest)Electricity Set Dates.qvd (qvd)&lt;BR /&gt;where not(isnull(daytype))&lt;BR /&gt;;&lt;BR /&gt;next;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hartleyr_0-1597315716598.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/38962i90E35ACED7236F11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hartleyr_0-1597315716598.png" alt="hartleyr_0-1597315716598.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:13:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Back-filled-data-causing-duplication/m-p/1735542#M591896</guid>
      <dc:creator>hartleyr</dc:creator>
      <dc:date>2024-11-16T18:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Back filled data causing duplication</title>
      <link>https://community.qlik.com/t5/QlikView/Back-filled-data-causing-duplication/m-p/1737031#M591897</link>
      <description>&lt;P&gt;Duplication was caused due to the connecting key being too generic.&amp;nbsp; Adding in a further identifier into this field has removed the duplication and corrected the issue&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 11:11:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Back-filled-data-causing-duplication/m-p/1737031#M591897</guid>
      <dc:creator>hartleyr</dc:creator>
      <dc:date>2020-08-19T11:11:05Z</dc:date>
    </item>
  </channel>
</rss>

