<?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 Merging data in a resident table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Merging-data-in-a-resident-table/m-p/715225#M257313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I&amp;nbsp; pull data from a cache database into a qvd file daily via extractor job.&lt;/P&gt;&lt;P&gt;I will create a resident table from this called InvFiscalCode, it has 3 columns InvNo, FiscalYM (format: YYYY-MM created from current date when loaded into this table), Code.&lt;/P&gt;&lt;P&gt;I need to update code if it changes for InvNo and FiscalYM everyday or insert row if InvNo,FiscalYM not found.&lt;/P&gt;&lt;P&gt;At the end of each month I will have the latest info for that row.&lt;/P&gt;&lt;P&gt;This process will start again for the next month.&lt;/P&gt;&lt;P&gt;We need to build a history so that we can track code changes by InvNo, FiscalYM going forward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A general idea of the syntax would be really helpful.&lt;/P&gt;&lt;P&gt;I am quite new to Qlikview so my developing days are starting...&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Aug 2014 13:56:20 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-08-20T13:56:20Z</dc:date>
    <item>
      <title>Merging data in a resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Merging-data-in-a-resident-table/m-p/715225#M257313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I&amp;nbsp; pull data from a cache database into a qvd file daily via extractor job.&lt;/P&gt;&lt;P&gt;I will create a resident table from this called InvFiscalCode, it has 3 columns InvNo, FiscalYM (format: YYYY-MM created from current date when loaded into this table), Code.&lt;/P&gt;&lt;P&gt;I need to update code if it changes for InvNo and FiscalYM everyday or insert row if InvNo,FiscalYM not found.&lt;/P&gt;&lt;P&gt;At the end of each month I will have the latest info for that row.&lt;/P&gt;&lt;P&gt;This process will start again for the next month.&lt;/P&gt;&lt;P&gt;We need to build a history so that we can track code changes by InvNo, FiscalYM going forward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A general idea of the syntax would be really helpful.&lt;/P&gt;&lt;P&gt;I am quite new to Qlikview so my developing days are starting...&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 13:56:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Merging-data-in-a-resident-table/m-p/715225#M257313</guid>
      <dc:creator />
      <dc:date>2014-08-20T13:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data in a resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Merging-data-in-a-resident-table/m-p/715226#M257314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks what you need is an incremental load. Take a look at this:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/121170"&gt;Qlikview Incremental Load&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 15:19:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Merging-data-in-a-resident-table/m-p/715226#M257314</guid>
      <dc:creator />
      <dc:date>2014-08-20T15:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data in a resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Merging-data-in-a-resident-table/m-p/715227#M257315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Guy,&lt;/P&gt;&lt;P&gt;Not very clear with your requirement. Can you please elaborate more?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 15:27:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Merging-data-in-a-resident-table/m-p/715227#M257315</guid>
      <dc:creator />
      <dc:date>2014-08-20T15:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data in a resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Merging-data-in-a-resident-table/m-p/715228#M257316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all and thanks for getting back to me.&lt;/P&gt;&lt;P&gt;here is a more detailed view of what I am trying to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This data is pulled from external database daily and stored in qvd file, they form a join by InvoiceNo&lt;/P&gt;&lt;P&gt;"INVOICETRANS2":&lt;/P&gt;&lt;P&gt;SELECT &lt;/P&gt;&lt;P&gt;rptinvnofiscal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as RptInvNoFiscal,&lt;/P&gt;&lt;P&gt;accountno&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as AccountNo,&lt;/P&gt;&lt;P&gt;invoiceno&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as InvoiceNo,&lt;/P&gt;&lt;P&gt;patientid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as PatientId,&lt;/P&gt;&lt;P&gt;ivid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as Ivid,&lt;/P&gt;&lt;P&gt;visitid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as VisitId,&lt;/P&gt;&lt;P&gt;invoicedate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as InvoiceDate,&lt;/P&gt;&lt;P&gt;invoicestatus&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as InvoiceStatus,&lt;/P&gt;&lt;P&gt;invoicetype&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as InvoiceType,&lt;/P&gt;&lt;P&gt;medicalaidfundcode&amp;nbsp;&amp;nbsp;&amp;nbsp; as MedicalAidFundCode,&lt;/P&gt;&lt;P&gt;medicalaidfunddesc&amp;nbsp;&amp;nbsp;&amp;nbsp; as MedicalAidFundDesc,&lt;/P&gt;&lt;P&gt;medicalaidnumber&amp;nbsp;&amp;nbsp;&amp;nbsp; as MedicalAidNumber,&lt;/P&gt;&lt;P&gt;employeetype&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as EmployeeType,&lt;/P&gt;&lt;P&gt;hospitalcategory&amp;nbsp;&amp;nbsp;&amp;nbsp; as HospitalCategory,&lt;/P&gt;&lt;P&gt;hospitalsubcategory&amp;nbsp;&amp;nbsp;&amp;nbsp; as HospitalSubCategory,&lt;/P&gt;&lt;P&gt;totalrevenue&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as TotalRevenue,&lt;/P&gt;&lt;P&gt;cancellations&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as Cancellations,&lt;/P&gt;&lt;P&gt;ratechanges&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as RateChanges,&lt;/P&gt;&lt;P&gt;netrevenue&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as NetRevenue,&lt;/P&gt;&lt;P&gt;batchpayments&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as BatchPayments,&lt;/P&gt;&lt;P&gt;cashierpayments&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as CashierPayments,&lt;/P&gt;&lt;P&gt;delegations&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as Delegations,&lt;/P&gt;&lt;P&gt;writeoffs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as WriteOffs,&lt;/P&gt;&lt;P&gt;systemtransactions&amp;nbsp;&amp;nbsp;&amp;nbsp; as SystemTransactions,&lt;/P&gt;&lt;P&gt;movement&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as Movement&lt;/P&gt;&lt;P&gt;FROM x.accruals;&lt;/P&gt;&lt;P&gt;store "INVOICETRANS2" into $(vQVDDebtPath)INVOICETRANS2.qvd;&lt;/P&gt;&lt;P&gt;drop table "INVOICETRANS2";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"MACLAIMS":&lt;/P&gt;&lt;P&gt;select InvoiceNo,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nvl(AmountClaimed,0) as AmountClaimed, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nvl(AmountPaid,0) as AmountPaid,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nvl(AmountDueByMedicalAid,0) as AmountDueByMA, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nvl(AmountDueByPatient,0) as AmountDueByPt, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as [MA Status Code]&lt;/P&gt;&lt;P&gt;from x.MedicalAidInvoices&lt;/P&gt;&lt;P&gt;where PatientID not in (select ExternalPatientNo from Z.TestPatients);&lt;/P&gt;&lt;P&gt;store "MACLAIMS" into $(vQVDDebtPath)MACLAIMS.qvd;&lt;/P&gt;&lt;P&gt;drop table "MACLAIMS";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a resident table InvFiscalCode based on the two tables above, &lt;/P&gt;&lt;P&gt;it has 3 columns InvoiceNo, FiscalYM (This column is populated with the date of when data is loaded into this resident table in format 'YYYY-MM'), MA Status Code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;The current date is 2014/08/01&lt;/P&gt;&lt;P&gt;First load I will have row like: &lt;/P&gt;&lt;P&gt;1,2014-08,B1&amp;nbsp;&amp;nbsp; (the current date is 2014/08/01)&lt;/P&gt;&lt;P&gt;Next daily load the current date is 2014/08/02&lt;/P&gt;&lt;P&gt;The row looks like this: 1,2014-08,H1&lt;/P&gt;&lt;P&gt;I now need to update the resident table InvFiscalCode so that it looks like this: 1,2014-08,H1&lt;/P&gt;&lt;P&gt;I now also have a new row like: 2,2014-08,Z1 which not in InvFiscalCode table and need to insert it.&lt;/P&gt;&lt;P&gt;I now have 2 rows that look like this:&lt;/P&gt;&lt;P&gt;1,2014-08,H1&lt;/P&gt;&lt;P&gt;2,2014-08,Z1&lt;/P&gt;&lt;P&gt;This process runs through the month.&lt;/P&gt;&lt;P&gt;At the end of 20014/08 the data then stays as is.&lt;/P&gt;&lt;P&gt;For 2014-09 after daily extraction the status for invoice may change or stay the same again:&lt;/P&gt;&lt;P&gt;invoice 1 may look like this:&lt;/P&gt;&lt;P&gt;1,2014-09,H1 (This now needs to be inserted based on invoice and FiscalYM)&lt;/P&gt;&lt;P&gt;and so this process continues.&lt;/P&gt;&lt;P&gt;What we want to see in this table over time is the latest status code for that invoice per month.&lt;/P&gt;&lt;P&gt;1,2014-08,H1&lt;/P&gt;&lt;P&gt;1,2014-09,H1&lt;/P&gt;&lt;P&gt;2,2014-08,Z1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can do this in oracle SQL but need help with qlikview syntax etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Guy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 06:01:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Merging-data-in-a-resident-table/m-p/715228#M257316</guid>
      <dc:creator />
      <dc:date>2014-08-21T06:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data in a resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Merging-data-in-a-resident-table/m-p/715229#M257317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ram&lt;/P&gt;&lt;P&gt;Thanks for getting back to me.&lt;/P&gt;&lt;P&gt;Here is a more detailed view of what I am trying to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This data is pulled from external database daily and stored in qvd file, they form a join by InvoiceNo&lt;/P&gt;&lt;P&gt;"INVOICETRANS2":&lt;/P&gt;&lt;P&gt;SELECT &lt;/P&gt;&lt;P&gt;rptinvnofiscal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as RptInvNoFiscal,&lt;/P&gt;&lt;P&gt;accountno&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as AccountNo,&lt;/P&gt;&lt;P&gt;invoiceno&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as InvoiceNo,&lt;/P&gt;&lt;P&gt;patientid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as PatientId,&lt;/P&gt;&lt;P&gt;ivid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as Ivid,&lt;/P&gt;&lt;P&gt;visitid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as VisitId,&lt;/P&gt;&lt;P&gt;invoicedate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as InvoiceDate,&lt;/P&gt;&lt;P&gt;invoicestatus&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as InvoiceStatus,&lt;/P&gt;&lt;P&gt;invoicetype&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as InvoiceType,&lt;/P&gt;&lt;P&gt;medicalaidfundcode&amp;nbsp;&amp;nbsp;&amp;nbsp; as MedicalAidFundCode,&lt;/P&gt;&lt;P&gt;medicalaidfunddesc&amp;nbsp;&amp;nbsp;&amp;nbsp; as MedicalAidFundDesc,&lt;/P&gt;&lt;P&gt;medicalaidnumber&amp;nbsp;&amp;nbsp;&amp;nbsp; as MedicalAidNumber,&lt;/P&gt;&lt;P&gt;employeetype&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as EmployeeType,&lt;/P&gt;&lt;P&gt;hospitalcategory&amp;nbsp;&amp;nbsp;&amp;nbsp; as HospitalCategory,&lt;/P&gt;&lt;P&gt;hospitalsubcategory&amp;nbsp;&amp;nbsp;&amp;nbsp; as HospitalSubCategory,&lt;/P&gt;&lt;P&gt;totalrevenue&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as TotalRevenue,&lt;/P&gt;&lt;P&gt;cancellations&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as Cancellations,&lt;/P&gt;&lt;P&gt;ratechanges&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as RateChanges,&lt;/P&gt;&lt;P&gt;netrevenue&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as NetRevenue,&lt;/P&gt;&lt;P&gt;batchpayments&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as BatchPayments,&lt;/P&gt;&lt;P&gt;cashierpayments&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as CashierPayments,&lt;/P&gt;&lt;P&gt;delegations&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as Delegations,&lt;/P&gt;&lt;P&gt;writeoffs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as WriteOffs,&lt;/P&gt;&lt;P&gt;systemtransactions&amp;nbsp;&amp;nbsp;&amp;nbsp; as SystemTransactions,&lt;/P&gt;&lt;P&gt;movement&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as Movement&lt;/P&gt;&lt;P&gt;FROM x.accruals;&lt;/P&gt;&lt;P&gt;store "INVOICETRANS2" into $(vQVDDebtPath)INVOICETRANS2.qvd;&lt;/P&gt;&lt;P&gt;drop table "INVOICETRANS2";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"MACLAIMS":&lt;/P&gt;&lt;P&gt;select InvoiceNo,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nvl(AmountClaimed,0) as AmountClaimed, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nvl(AmountPaid,0) as AmountPaid,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nvl(AmountDueByMedicalAid,0) as AmountDueByMA, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nvl(AmountDueByPatient,0) as AmountDueByPt, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as [MA Status Code]&lt;/P&gt;&lt;P&gt;from x.MedicalAidInvoices&lt;/P&gt;&lt;P&gt;where PatientID not in (select ExternalPatientNo from Z.TestPatients);&lt;/P&gt;&lt;P&gt;store "MACLAIMS" into $(vQVDDebtPath)MACLAIMS.qvd;&lt;/P&gt;&lt;P&gt;drop table "MACLAIMS";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a resident table InvFiscalCode based on the two tables above, &lt;/P&gt;&lt;P&gt;it has 3 columns InvoiceNo, FiscalYM (This column is populated with the date of when data is loaded into this resident table in format 'YYYY-MM'), MA Status Code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;The current date is 2014/08/01&lt;/P&gt;&lt;P&gt;First load I will have row like: &lt;/P&gt;&lt;P&gt;1,2014-08,B1&amp;nbsp;&amp;nbsp; (the current date is 2014/08/01)&lt;/P&gt;&lt;P&gt;Next daily load the current date is 2014/08/02&lt;/P&gt;&lt;P&gt;The row looks like this: 1,2014-08,H1&lt;/P&gt;&lt;P&gt;I now need to update the resident table InvFiscalCode so that it looks like this: 1,2014-08,H1&lt;/P&gt;&lt;P&gt;I now also have a new row like: 2,2014-08,Z1 which not in InvFiscalCode table and need to insert it.&lt;/P&gt;&lt;P&gt;I now have 2 rows that look like this:&lt;/P&gt;&lt;P&gt;1,2014-08,H1&lt;/P&gt;&lt;P&gt;2,2014-08,Z1&lt;/P&gt;&lt;P&gt;This process runs through the month.&lt;/P&gt;&lt;P&gt;At the end of 20014/08 the data then stays as is.&lt;/P&gt;&lt;P&gt;For 2014-09 after daily extraction the status for invoice may change or stay the same again:&lt;/P&gt;&lt;P&gt;invoice 1 may look like this:&lt;/P&gt;&lt;P&gt;1,2014-09,H1 (This now needs to be inserted based on invoice and FiscalYM)&lt;/P&gt;&lt;P&gt;and so this process continues.&lt;/P&gt;&lt;P&gt;What we want to see in this table over time is the latest status code for that invoice per month.&lt;/P&gt;&lt;P&gt;1,2014-08,H1&lt;/P&gt;&lt;P&gt;1,2014-09,H1&lt;/P&gt;&lt;P&gt;2,2014-08,Z1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can do this in oracle SQL but need help with qlikview syntax etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Guy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 09:18:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Merging-data-in-a-resident-table/m-p/715229#M257317</guid>
      <dc:creator />
      <dc:date>2014-08-21T09:18:06Z</dc:date>
    </item>
  </channel>
</rss>

