<?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: Data Model Scripting Question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844060#M652773</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example, imagine that an ESFA_ID should take the form ABCD1234, then something like this could do the job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MapIDsToEliminate:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MAPPING LOAD *, 1 AS Flag INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;2015&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333330154419px;"&gt;chck&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NONSENSE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;99999999&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;??Wait??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Transactions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FROM ... (qvd)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WHERE Not applymap('&lt;SPAN style="font-size: 13.3333330154419px;"&gt;MapIDsToEliminate&lt;/SPAN&gt;', ESFA_ID, false());&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main advantage of Mapping Table vs (wild)match is that an INLINE source is easier to maintain and can be easily converted into an external source (if the illegal-ID-table keeps growing)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recently used something similar to correct absurd transaction dates that had obviously been the result of typing errors (like Jun 6, 3012). This trick can be used when there aren't too many corrections to make.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jul 2015 07:38:45 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2015-07-13T07:38:45Z</dc:date>
    <item>
      <title>Data Model Scripting Question</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844054#M652767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a quick data model question that should be rather easy. I can't think of an optimal solution. There is only 3 tables involved:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Accounts:&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; &lt;/P&gt;&lt;P&gt;AccountID,&lt;/P&gt;&lt;P&gt;ESFA_ID,&lt;/P&gt;&lt;P&gt;[Golf_Account?]&lt;/P&gt;&lt;P&gt;OtherAttributeDataFields&lt;/P&gt;&lt;P&gt;from AcctBLAH.qvd (qvd)&lt;/P&gt;&lt;P&gt;WHERE &lt;SPAN style="font-size: 13.3333330154419px;"&gt;[Golf_Account?] = 'TrueDat'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GolfDataSnapshot:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;AccountID,&lt;/P&gt;&lt;P&gt;SnapShotDate,&lt;/P&gt;&lt;P&gt;GolfDataFields&lt;/P&gt;&lt;P&gt;from GolfBLAH.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ESFA_History:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;ESFA_ID,&lt;/P&gt;&lt;P&gt;SnapShotDate,&lt;/P&gt;&lt;P&gt;ESFADataFields&lt;/P&gt;&lt;P&gt;from ESFA_BLAH.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Part of the problem is that some of the attribute data that's in ESFA_History can be found in the other two tables as well. Accounts should have most of the attribute data for the other two tables in it. SnapShotDate is totally different values between GolfDataSnapshot and ESFA_History. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking the best approach would be to Concatenate &lt;SPAN style="font-size: 13.3333330154419px;"&gt;GolfDataSnapshot and ESFA_History, but this doesn't allow for a good relationship between AccountID field and ESFA_ID field. However, both of these fields can be found in accounts. I'm afraid of using joins, as i don't want to cut out any snapshot dates (GolfDataSnapshot table currently has 1 snapshot, ESFA_History has several). Any Thoughts? The Delta Load for GolfDataSnapshot literally just concatenates onto itself every month with Date(Today()) as the definition of SnapShotDate field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 16:22:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844054#M652767</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-09T16:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Scripting Question</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844055#M652768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there is there a 1:1 relationship between AccountID and ESFA_ID in Accounts? What is the nature of the data in ESFA_History and how does it relate to GolfDataSnapShot?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's pretty difficult to assemble a workable data model without a single clue as to where you would like to get at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 16:37:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844055#M652768</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-07-09T16:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Scripting Question</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844056#M652769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, there is a 1:1 relationship between &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;AccountID and ESFA_ID in Accounts. Sorry for the lack of clarity. Essentially, ESFA_History is a decommissioned CRM system table and&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; GolfDataSnapShot is a new, similar (probably not exact, but that's not anybodies problem but mine) table from SalesForce CRM. Some of the fields in ESFA_History, upon renaming, would contain values found in the other two tables. But, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;ESFA_History should be a historical version of GolfDataSnapShot.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 17:40:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844056#M652769</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-09T17:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Scripting Question</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844057#M652770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correction, there's a few ESFA_IDs with two AccountID's. I think they &lt;EM&gt;should &lt;/EM&gt;be 1:1, though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2015 17:57:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844057#M652770</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-09T17:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Scripting Question</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844058#M652771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ron,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I would do is exactly the same as you suggested yourself initially: masssage all the data so that it fits in a single table. You can do this by distilling a Mapping Table from Accounts that translates ESFA_ID into a single AccountID. Since AccountID is an index into the currently used CRM system, we'll keep that one and eliminate ESFA_ID (or turn it into a non-key field, just for reference). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upon loading the ESFA_History table, translate the ESFA_ID into an AccountID using the mapping table and concatenate the rows to the GolfDataSnapShot, thereby renaming all corresponding ESFA_History fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The few exceptions (having two AccountID's) should be analyzed manually; you can then decide what to do about them: drop one (again using a mapping table that contains a list of "illegal" ESFA_ID's), merge information into a single row or something else. This is just a data quality phase and should be manageable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this sound useful to you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2015 08:21:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844058#M652771</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-07-10T08:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Scripting Question</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844059#M652772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a good solution and i think the best way to handle this situation properly. Upon further investigation, the data is in a great need of cleansing; more so than i expected. I'm dropping the duplicates and bad account names with WHERE clauses (where not wildmatch(Name, '*USE ACCOUNT BLAH*') or something like not wildmatch(Name, '*DELETED ACCOUNT*') etc. &amp;lt;-- this is the kind stuff i'm battling with) . There are too many to pick individual accounts out for a mapping table. By the way, would you please go further into the mapping table containing "illegal" ESFA_ID's? I can't envision how to script for that. It sounds useful for future endeavors if you wouldn't mind sharing with us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Ron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jul 2015 22:38:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844059#M652772</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-12T22:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Scripting Question</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844060#M652773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example, imagine that an ESFA_ID should take the form ABCD1234, then something like this could do the job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MapIDsToEliminate:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MAPPING LOAD *, 1 AS Flag INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;2015&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333330154419px;"&gt;chck&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NONSENSE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;99999999&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;??Wait??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Transactions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FROM ... (qvd)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;WHERE Not applymap('&lt;SPAN style="font-size: 13.3333330154419px;"&gt;MapIDsToEliminate&lt;/SPAN&gt;', ESFA_ID, false());&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main advantage of Mapping Table vs (wild)match is that an INLINE source is easier to maintain and can be easily converted into an external source (if the illegal-ID-table keeps growing)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recently used something similar to correct absurd transaction dates that had obviously been the result of typing errors (like Jun 6, 3012). This trick can be used when there aren't too many corrections to make.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 07:38:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844060#M652773</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-07-13T07:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Scripting Question</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844061#M652774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 12:27:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Scripting-Question/m-p/844061#M652774</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-13T12:27:56Z</dc:date>
    </item>
  </channel>
</rss>

