<?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 How do I alter existing data? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-I-alter-existing-data/m-p/195342#M55879</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;BR /&gt;I have the following data about our customers:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt; Web_CustomerId,&lt;BR /&gt; Web_CustomerId as Web_CustomerIdCountable,&lt;BR /&gt; Web_CustomerId + 73081 as Web_CustomerId_hash,&lt;BR /&gt; Web_FirstName,&lt;BR /&gt; Web_LastName,&lt;BR /&gt; Web_CivicNumber,&lt;BR /&gt; Web_EMail,&lt;BR /&gt; Web_GroupId,&lt;BR /&gt; Web_CustomerStatusId,&lt;BR /&gt; Web_ChannelId,&lt;BR /&gt; Web_AccountCreated,&lt;BR /&gt; Web_Age,&lt;BR /&gt; Web_CustomerOrderStatusId,&lt;BR /&gt; date(floor(num(Web_FirstOrderDateTime)), 'YYYY-MM-DD') as Web_FirstOrderDateTime,&lt;BR /&gt; date(floor(num(Web_LastOrderDateTime)), 'YYYY-MM-DD') as Web_LastOrderDateTime,&lt;BR /&gt; Web_IsCompany,&lt;BR /&gt; Web_IsEmailForbidden,&lt;BR /&gt; //Default logic for newsletters goes here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To this data I want to add which types of newsletters the customer would like to receive.&lt;/P&gt;&lt;P&gt;I.e.&lt;BR /&gt;Regular newsletter&lt;BR /&gt;Offers based on prior purchases&lt;BR /&gt;Vouchers and freight free offers&lt;BR /&gt;Erotic newsletter&lt;/P&gt;&lt;P&gt;This data I have in a separate file as follows&lt;/P&gt;&lt;P&gt;left join(Web_Customer)&lt;BR /&gt;LOAD Web_CustomerId,&lt;BR /&gt; if(Web_SubscriptionMediaId = 1, Web_SubscriptionMediaId) as SubscriptionType_Newsletter,&lt;BR /&gt; if(Web_SubscriptionMediaId = 2, Web_SubscriptionMediaId) as SubscriptionType_Offer,&lt;BR /&gt; if(Web_SubscriptionMediaId = 3, Web_SubscriptionMediaId) as SubscriptionType_Voucher,&lt;BR /&gt; if(Web_SubscriptionMediaId = 4, Web_SubscriptionMediaId) as SubscriptionType_Erotic,&lt;BR /&gt; Web_SubscriptionChannelId,&lt;BR /&gt; if(Web_SubscriptionMediaId = 1, Web_IsActive) as IsActive_Newsletter,&lt;BR /&gt; if(Web_SubscriptionMediaId = 2, Web_IsActive) as IsActive_Offer,&lt;BR /&gt; if(Web_SubscriptionMediaId = 3, Web_IsActive) as IsActive_Voucher,&lt;BR /&gt; if(Web_SubscriptionMediaId = 4, Web_IsActive) as IsActive_Erotic&lt;BR /&gt;FROM &lt;B&gt;&lt;I&gt;$(include=pathWeb.txt)&lt;/I&gt;&lt;/B&gt;Web_SubscriptionMatrix.csv&lt;/P&gt;&lt;P&gt;My problem is that not all customers are in the file called Web_SubscriptionMatrix.&lt;BR /&gt;Customers that are not in the file have to fall back to a default setting and this is where I run into problems.&lt;BR /&gt;I figure the default settings for each customer should be created in the initial load of Web_Customer (the logic for this is not in the LOAD statment above) and then those customers that are in the Web_SubscriptionMatrix file needs to be updated in the Web_Customer table.&lt;/P&gt;&lt;P&gt;The problem that I have run into is that I have not found a way to alter the information in the Web_Customer table once it has been loaded.&lt;BR /&gt;I have tried using add load and done a partial reload bur with no success.&lt;/P&gt;&lt;P&gt;Does anyone have any ideás on how to solve this?&lt;/P&gt;&lt;P&gt;br&lt;BR /&gt;Martin&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Apr 2011 21:52:58 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-01T21:52:58Z</dc:date>
    <item>
      <title>How do I alter existing data?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-alter-existing-data/m-p/195342#M55879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;BR /&gt;I have the following data about our customers:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt; Web_CustomerId,&lt;BR /&gt; Web_CustomerId as Web_CustomerIdCountable,&lt;BR /&gt; Web_CustomerId + 73081 as Web_CustomerId_hash,&lt;BR /&gt; Web_FirstName,&lt;BR /&gt; Web_LastName,&lt;BR /&gt; Web_CivicNumber,&lt;BR /&gt; Web_EMail,&lt;BR /&gt; Web_GroupId,&lt;BR /&gt; Web_CustomerStatusId,&lt;BR /&gt; Web_ChannelId,&lt;BR /&gt; Web_AccountCreated,&lt;BR /&gt; Web_Age,&lt;BR /&gt; Web_CustomerOrderStatusId,&lt;BR /&gt; date(floor(num(Web_FirstOrderDateTime)), 'YYYY-MM-DD') as Web_FirstOrderDateTime,&lt;BR /&gt; date(floor(num(Web_LastOrderDateTime)), 'YYYY-MM-DD') as Web_LastOrderDateTime,&lt;BR /&gt; Web_IsCompany,&lt;BR /&gt; Web_IsEmailForbidden,&lt;BR /&gt; //Default logic for newsletters goes here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To this data I want to add which types of newsletters the customer would like to receive.&lt;/P&gt;&lt;P&gt;I.e.&lt;BR /&gt;Regular newsletter&lt;BR /&gt;Offers based on prior purchases&lt;BR /&gt;Vouchers and freight free offers&lt;BR /&gt;Erotic newsletter&lt;/P&gt;&lt;P&gt;This data I have in a separate file as follows&lt;/P&gt;&lt;P&gt;left join(Web_Customer)&lt;BR /&gt;LOAD Web_CustomerId,&lt;BR /&gt; if(Web_SubscriptionMediaId = 1, Web_SubscriptionMediaId) as SubscriptionType_Newsletter,&lt;BR /&gt; if(Web_SubscriptionMediaId = 2, Web_SubscriptionMediaId) as SubscriptionType_Offer,&lt;BR /&gt; if(Web_SubscriptionMediaId = 3, Web_SubscriptionMediaId) as SubscriptionType_Voucher,&lt;BR /&gt; if(Web_SubscriptionMediaId = 4, Web_SubscriptionMediaId) as SubscriptionType_Erotic,&lt;BR /&gt; Web_SubscriptionChannelId,&lt;BR /&gt; if(Web_SubscriptionMediaId = 1, Web_IsActive) as IsActive_Newsletter,&lt;BR /&gt; if(Web_SubscriptionMediaId = 2, Web_IsActive) as IsActive_Offer,&lt;BR /&gt; if(Web_SubscriptionMediaId = 3, Web_IsActive) as IsActive_Voucher,&lt;BR /&gt; if(Web_SubscriptionMediaId = 4, Web_IsActive) as IsActive_Erotic&lt;BR /&gt;FROM &lt;B&gt;&lt;I&gt;$(include=pathWeb.txt)&lt;/I&gt;&lt;/B&gt;Web_SubscriptionMatrix.csv&lt;/P&gt;&lt;P&gt;My problem is that not all customers are in the file called Web_SubscriptionMatrix.&lt;BR /&gt;Customers that are not in the file have to fall back to a default setting and this is where I run into problems.&lt;BR /&gt;I figure the default settings for each customer should be created in the initial load of Web_Customer (the logic for this is not in the LOAD statment above) and then those customers that are in the Web_SubscriptionMatrix file needs to be updated in the Web_Customer table.&lt;/P&gt;&lt;P&gt;The problem that I have run into is that I have not found a way to alter the information in the Web_Customer table once it has been loaded.&lt;BR /&gt;I have tried using add load and done a partial reload bur with no success.&lt;/P&gt;&lt;P&gt;Does anyone have any ideás on how to solve this?&lt;/P&gt;&lt;P&gt;br&lt;BR /&gt;Martin&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 21:52:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-alter-existing-data/m-p/195342#M55879</guid>
      <dc:creator />
      <dc:date>2011-04-01T21:52:58Z</dc:date>
    </item>
    <item>
      <title>How do I alter existing data?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-alter-existing-data/m-p/195343#M55880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One idea would be to load Web_SubscriptionMatrix.csv first and then left join with your Customer master file.&lt;/P&gt;&lt;P&gt;So something like:&lt;/P&gt;&lt;P&gt;Customers:&lt;/P&gt;&lt;P&gt;LOAD Web_CustomerId,&lt;/P&gt;&lt;P&gt;Web_CustomerId as tmp_id,&lt;/P&gt;&lt;P&gt;..........&lt;/P&gt;&lt;P&gt;from Web_SubscriptionMatrix.csv;&lt;/P&gt;&lt;P&gt;Left join (Customers)&lt;/P&gt;&lt;P&gt;LOAD ... from CustomerMasterFile;&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;So now you have complete records for all the customer which have an entry in Web_SubscriptionMatrix.csv file.&lt;/P&gt;&lt;P&gt;Now using CONCATENATE LOAD and NOT Exists() functions you could load rest of the Customers from CustomerMaster, hard coding Newsletter, etc fields. Something like:&lt;/P&gt;&lt;P&gt;CONCATENATE(Customer)&lt;/P&gt;&lt;P&gt;LOAD Web_CustomerId,&lt;/P&gt;&lt;P&gt;Web_CustomerId as tmp_Id,&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;'Regular Newsletter' as SubscriptionType_Newsletter,&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;FROM CustomerMasterFile&lt;/P&gt;&lt;P&gt;WHERE Not Exists (tmp_Id, Web_CustomerId);&lt;/P&gt;&lt;P&gt;DROP Field tmp_Id;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Apr 2011 01:49:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-alter-existing-data/m-p/195343#M55880</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2011-04-02T01:49:27Z</dc:date>
    </item>
  </channel>
</rss>

