<?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 Data Reduction After 3-Tier Load in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Data-Reduction-After-3-Tier-Load/m-p/75191#M4999</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We've developed a fairly comprehensive 3-tier data model app that includes all of our company's products, channels, sales transaction data, account balance data, etc.&amp;nbsp; For our end-user apps, we then just do a binary load from that 3-tier data model.&amp;nbsp; The problem we have is that most of our apps focus on specific products, channels, etc. - meaning we don't need every bit of data in our 3-tier data model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we end up doing a data reduction step in our end-user apps, to subset the data down to just what we need.&amp;nbsp; Removing data model width (tables, columns, etc.) is easy - we can quickly and easily drop whole tables we don't need, drop unneeded fields, etc. using drop statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reducing the "depth" of the data has been problematic, though.&amp;nbsp; When we want to build an app for a specific product, for example, we typically reload the main dimension table using a resident load, and use a where clause to limit the data.&amp;nbsp; Unfortunately, that leaves us with a lot of orphan fact table data: sales transactions for other products, account balances for accounts no longer included, etc.&amp;nbsp; So when we put up a KPI showing Total Sales YTD, for example, the KPI includes all that orphan data and overstates the total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We would rather not have to do a lot of set analysis coding in measures in the app, so we've been trying to use code in the load script to remove the orphan data from the various fact tables.&amp;nbsp; We've been using right joins to do this - but it's code I found online somewhere and I don't really understand how or why it works - and the problem is that it doesn't always seem to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;//Reduce overall data model to Product A.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;//Filter main dimension table down.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Main_Dimension_Table_New:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;NOCONCATENATE load *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;resident Main_Dimension_Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;where Product='Product A';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DROP TABLE Main_Dimension_Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Rename Table Main_Dimension_Table_New to Main_Dimension_Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;//Do right join with Sales Data to get rid of records that aren't in the main dimension table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;right Join (SalesData)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SalesData_Dedup:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;load distinct&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Primary_Key&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;resident Main_Dimension_Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;So my question is: Is the above code the best way to reduce data after a binary load, or are there better alternatives?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Steve&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Apr 2018 16:15:31 GMT</pubDate>
    <dc:creator>steverosebrook</dc:creator>
    <dc:date>2018-04-21T16:15:31Z</dc:date>
    <item>
      <title>Data Reduction After 3-Tier Load</title>
      <link>https://community.qlik.com/t5/App-Development/Data-Reduction-After-3-Tier-Load/m-p/75191#M4999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We've developed a fairly comprehensive 3-tier data model app that includes all of our company's products, channels, sales transaction data, account balance data, etc.&amp;nbsp; For our end-user apps, we then just do a binary load from that 3-tier data model.&amp;nbsp; The problem we have is that most of our apps focus on specific products, channels, etc. - meaning we don't need every bit of data in our 3-tier data model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we end up doing a data reduction step in our end-user apps, to subset the data down to just what we need.&amp;nbsp; Removing data model width (tables, columns, etc.) is easy - we can quickly and easily drop whole tables we don't need, drop unneeded fields, etc. using drop statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reducing the "depth" of the data has been problematic, though.&amp;nbsp; When we want to build an app for a specific product, for example, we typically reload the main dimension table using a resident load, and use a where clause to limit the data.&amp;nbsp; Unfortunately, that leaves us with a lot of orphan fact table data: sales transactions for other products, account balances for accounts no longer included, etc.&amp;nbsp; So when we put up a KPI showing Total Sales YTD, for example, the KPI includes all that orphan data and overstates the total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We would rather not have to do a lot of set analysis coding in measures in the app, so we've been trying to use code in the load script to remove the orphan data from the various fact tables.&amp;nbsp; We've been using right joins to do this - but it's code I found online somewhere and I don't really understand how or why it works - and the problem is that it doesn't always seem to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;//Reduce overall data model to Product A.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;//Filter main dimension table down.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Main_Dimension_Table_New:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;NOCONCATENATE load *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;resident Main_Dimension_Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;where Product='Product A';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;DROP TABLE Main_Dimension_Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Rename Table Main_Dimension_Table_New to Main_Dimension_Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;//Do right join with Sales Data to get rid of records that aren't in the main dimension table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;right Join (SalesData)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;SalesData_Dedup:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;load distinct&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Primary_Key&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;resident Main_Dimension_Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;So my question is: Is the above code the best way to reduce data after a binary load, or are there better alternatives?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Steve&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Apr 2018 16:15:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-Reduction-After-3-Tier-Load/m-p/75191#M4999</guid>
      <dc:creator>steverosebrook</dc:creator>
      <dc:date>2018-04-21T16:15:31Z</dc:date>
    </item>
  </channel>
</rss>

