<?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 Replace data in existing fields in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Replace-data-in-existing-fields/m-p/138394#M9727</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an app that is doing a binary load of our data model which has a lot of data. I use this app to bring in data from excels and other data sources. I wanted to see if there is a simple loading script solution for replacing values in a field. For example, in my data model I have a table called “Base Table” that has about 100 column which is unique on the field “ItemNo”. I have five fields in this table that are called “Value_1”, “Value_2”, “Value_3”, “Value_4” &amp;amp; “Value_5”.&amp;nbsp; I have about 90k distinct values for “ItemNo”.&amp;nbsp; I have an excel file that I am loading in following my binary load that contains data for 1,000 of the “ItemNos” that are in the data model. In this excel, I have data for the 5 “Value” fields that I feel are more accurate than what is in my data model. So I see two possible options. I could load in these 5 fields from my excel with a different naming convention (for example, “Value_1_External”, “Value_2_External”…) or I could somehow replace the data for these 5 fields for just these 1,000 “ItemNos”. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really would rather do the second option. I wrote a script that does the following steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Load in excel file into table “New Data”&lt;/LI&gt;&lt;LI&gt;Create a Mapping table for just the “ItemNos” that exist in the excel file. &lt;/LI&gt;&lt;LI&gt;Create a new table called “Temp” which loads in all of the data from my “Base Table” for ItemNos that are in the excel. I use the Mapping table to isolate to my population that is only in the excel.&lt;/LI&gt;&lt;LI&gt;Drop the fields “Value_1”, “Value_2”, “Value_3”, “Value_4” &amp;amp; “Value_5” from “Temp”&lt;/LI&gt;&lt;LI&gt;Left Join data from “New Data” to “Temp”. This will bring in the correct data for fields “Value_1”, “Value_2”, “Value_3”, “Value_4” &amp;amp; “Value_5”&lt;/LI&gt;&lt;LI&gt;Concatenate to “Temp” table all data from “Base Table” for only ItemNos that aren’t in the excel. Again I use the Mapping table to isolate to my population that is only in the excel.&lt;/LI&gt;&lt;LI&gt;Drop “Base Table”. Rename “Temp” to “Base Table”&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if there is a process that is easier than this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Oct 2018 18:57:21 GMT</pubDate>
    <dc:creator>bdroesch</dc:creator>
    <dc:date>2018-10-25T18:57:21Z</dc:date>
    <item>
      <title>Replace data in existing fields</title>
      <link>https://community.qlik.com/t5/App-Development/Replace-data-in-existing-fields/m-p/138394#M9727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an app that is doing a binary load of our data model which has a lot of data. I use this app to bring in data from excels and other data sources. I wanted to see if there is a simple loading script solution for replacing values in a field. For example, in my data model I have a table called “Base Table” that has about 100 column which is unique on the field “ItemNo”. I have five fields in this table that are called “Value_1”, “Value_2”, “Value_3”, “Value_4” &amp;amp; “Value_5”.&amp;nbsp; I have about 90k distinct values for “ItemNo”.&amp;nbsp; I have an excel file that I am loading in following my binary load that contains data for 1,000 of the “ItemNos” that are in the data model. In this excel, I have data for the 5 “Value” fields that I feel are more accurate than what is in my data model. So I see two possible options. I could load in these 5 fields from my excel with a different naming convention (for example, “Value_1_External”, “Value_2_External”…) or I could somehow replace the data for these 5 fields for just these 1,000 “ItemNos”. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really would rather do the second option. I wrote a script that does the following steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Load in excel file into table “New Data”&lt;/LI&gt;&lt;LI&gt;Create a Mapping table for just the “ItemNos” that exist in the excel file. &lt;/LI&gt;&lt;LI&gt;Create a new table called “Temp” which loads in all of the data from my “Base Table” for ItemNos that are in the excel. I use the Mapping table to isolate to my population that is only in the excel.&lt;/LI&gt;&lt;LI&gt;Drop the fields “Value_1”, “Value_2”, “Value_3”, “Value_4” &amp;amp; “Value_5” from “Temp”&lt;/LI&gt;&lt;LI&gt;Left Join data from “New Data” to “Temp”. This will bring in the correct data for fields “Value_1”, “Value_2”, “Value_3”, “Value_4” &amp;amp; “Value_5”&lt;/LI&gt;&lt;LI&gt;Concatenate to “Temp” table all data from “Base Table” for only ItemNos that aren’t in the excel. Again I use the Mapping table to isolate to my population that is only in the excel.&lt;/LI&gt;&lt;LI&gt;Drop “Base Table”. Rename “Temp” to “Base Table”&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if there is a process that is easier than this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2018 18:57:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Replace-data-in-existing-fields/m-p/138394#M9727</guid>
      <dc:creator>bdroesch</dc:creator>
      <dc:date>2018-10-25T18:57:21Z</dc:date>
    </item>
  </channel>
</rss>

