<?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 Model Problem with Mixed Fact/Dimension table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585437#M217240</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone.&amp;nbsp; I have a problem trying to setup a data model that works for a case with a fact table that is also a dimension table.&amp;nbsp; I have created a simplified version to illustrate (attached).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I have a concatenated fact table with payroll data and hazard data (and other stuff) in it.&amp;nbsp; This table has keys of date/employee/location.&amp;nbsp; Location is only used for hazard data. It is null for the other records.&lt;/P&gt;&lt;P&gt;I also have a staff table, which also has a location field (staff working location).&amp;nbsp; I also need the location table because it has many other fields that I need (postcode/building size/etc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the data model that is created by QV with synthetic keys:&lt;IMG __jive_id="55214" alt="Mixed Fact and Dimension.png" class="jive-image" src="/legacyfs/online/55214_Mixed Fact and Dimension.png" style="width: 620px; height: 273px;" /&gt;&lt;/P&gt;&lt;P&gt;As you can see in the simple pivot table, If I try to get pay by firstname and amount, it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have reviewed many documents and sample regarding link tables, but the difference is that my second fact table is also a dimension table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help, I can feel my brain melting!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Mar 2014 22:08:16 GMT</pubDate>
    <dc:creator>shanemichelon</dc:creator>
    <dc:date>2014-03-17T22:08:16Z</dc:date>
    <item>
      <title>Data Model Problem with Mixed Fact/Dimension table</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585437#M217240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone.&amp;nbsp; I have a problem trying to setup a data model that works for a case with a fact table that is also a dimension table.&amp;nbsp; I have created a simplified version to illustrate (attached).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I have a concatenated fact table with payroll data and hazard data (and other stuff) in it.&amp;nbsp; This table has keys of date/employee/location.&amp;nbsp; Location is only used for hazard data. It is null for the other records.&lt;/P&gt;&lt;P&gt;I also have a staff table, which also has a location field (staff working location).&amp;nbsp; I also need the location table because it has many other fields that I need (postcode/building size/etc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the data model that is created by QV with synthetic keys:&lt;IMG __jive_id="55214" alt="Mixed Fact and Dimension.png" class="jive-image" src="/legacyfs/online/55214_Mixed Fact and Dimension.png" style="width: 620px; height: 273px;" /&gt;&lt;/P&gt;&lt;P&gt;As you can see in the simple pivot table, If I try to get pay by firstname and amount, it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have reviewed many documents and sample regarding link tables, but the difference is that my second fact table is also a dimension table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help, I can feel my brain melting!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 22:08:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585437#M217240</guid>
      <dc:creator>shanemichelon</dc:creator>
      <dc:date>2014-03-17T22:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Problem with Mixed Fact/Dimension table</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585438#M217241</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;Please attached file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;JaswantC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 23:14:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585438#M217241</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-17T23:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Data Model Problem with Mixed Fact/Dimension table</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585439#M217242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your incredibly fast reply!&amp;nbsp; However there is a problem with the solution.&amp;nbsp; In the data there is a hazard for location 100 (Head Office).&amp;nbsp; If you Create a list box for locations and select Head Office, it excludes the Hazard.&amp;nbsp; Ie Hazards are not tied to locations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="55222" alt="Mixed Fact and Dimension 2.png" class="jive-image" src="/legacyfs/online/55222_Mixed Fact and Dimension 2.png" style="width: 620px; height: 178px;" /&gt;&lt;/P&gt;&lt;P&gt;Ideally, I would like to create a dashboard table that shows hazards by location and amount paid to staff by location.&amp;nbsp; Eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Location&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; No Hazard&amp;nbsp; Payroll Total&lt;/P&gt;&lt;P&gt;Head Office&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $4,000&lt;/P&gt;&lt;P&gt;Branch Office&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $1,000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment, it looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Mixed Fact and Dimension 3.png" class="jive-image" src="/legacyfs/online/55223_Mixed Fact and Dimension 3.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 23:24:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585439#M217242</guid>
      <dc:creator>shanemichelon</dc:creator>
      <dc:date>2014-03-17T23:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Data Model Problem with Mixed Fact/Dimension table</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585440#M217243</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;Please find updated one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 23:46:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585440#M217243</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-17T23:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Data Model Problem with Mixed Fact/Dimension table</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585441#M217244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for your assistance.&amp;nbsp; However, the table still does not link hazards to locations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Mixed Fact and Dimension 4.png" class="jive-image" src="/legacyfs/online/55224_Mixed Fact and Dimension 4.png" style="width: 620px; height: 206px;" /&gt;&lt;/P&gt;&lt;P&gt;I have attached your solution with a pivot table showing the summary info.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 23:52:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585441#M217244</guid>
      <dc:creator>shanemichelon</dc:creator>
      <dc:date>2014-03-17T23:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Data Model Problem with Mixed Fact/Dimension table</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585442#M217245</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;Can you check again my previous post?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here again i am attaching same file with additional metric what you are looking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;IMG alt="Capture.PNG" class="jive-image" src="https://community.qlik.com/legacyfs/online/55288_Capture.PNG" style="width: 620px; height: 178px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 16:57:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585442#M217245</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-03-18T16:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Data Model Problem with Mixed Fact/Dimension table</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585443#M217246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for your continued assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I think I made the example a little too simple. In my actual case, I have other metrics about the Hazards.&amp;nbsp; Such as Hazard type code, description etc.&amp;nbsp; In you sample, you have eliminated the hazard table and not added it to the fact table.&amp;nbsp; How can we accommodate extra hazard info such as a hazard type, hazard description etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 22:42:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585443#M217246</guid>
      <dc:creator>shanemichelon</dc:creator>
      <dc:date>2014-03-18T22:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Re: Data Model Problem with Mixed Fact/Dimension table</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585444#M217247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I have solved this myself.&amp;nbsp; Effectively we need to treat employee plus location as a single combined key.&amp;nbsp; The fact tale will then have a dimension of %EmployeeCodeLocation.&amp;nbsp; When the fact table is populated, build the %EmployeeLocation key as you go.&amp;nbsp; If one of the two bits is not relevant just leave it blank.&amp;nbsp; Then load the link table from this.&amp;nbsp; Create one record for every record in the fact table.&amp;nbsp; Simply use SubField to break the %EmployeeLocation filed into the two parts to link to staff and locations dimension tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the new data model:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="55626" alt="Mixed Fact and Dimension Solved Data Model.png" class="jive-image" src="/legacyfs/online/55626_Mixed Fact and Dimension Solved Data Model.png" /&gt;&lt;/P&gt;&lt;P&gt;Here is the UI view:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="55627" alt="Mixed Fact and Dimension Solved Tables.png" class="jive-image" src="/legacyfs/online/55627_Mixed Fact and Dimension Solved Tables.png" style="width: 620px; height: 213px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have attached the solute for reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and I hope this is useful to someone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2014 06:31:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Model-Problem-with-Mixed-Fact-Dimension-table/m-p/585444#M217247</guid>
      <dc:creator>shanemichelon</dc:creator>
      <dc:date>2014-03-23T06:31:10Z</dc:date>
    </item>
  </channel>
</rss>

