<?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 Modelling Advice in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Data-Modelling-Advice/m-p/877733#M659364</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;Could do with some data modelling advice for a QlikView data model with training data. I've not got access to the app right now so I can't copy the script or print screen the data model...so I'll have to explain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables - dimTraining and dimEvents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dimTraining: the lowest level in this table is CourseRef, CourseDate and EmployeeRef. This is a table of all the courses created over the days they run on. There is a countEmployee field which is a count of the records.&lt;/P&gt;&lt;P&gt;dimEvents: the lowest level in this table is CourseRef, CourseDate (just data on the events). This is a table of which employees are booked on each course by day. There is a countEvent field which is a count of the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;note: not all the CourseRef values in dimEvents exist in dimTraining, only once employees are booked on the course.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a Facts table using resident loads from these dimension tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Facts table links to dimTraining on a compound key %_CourseDateEmp&lt;/P&gt;&lt;P&gt;The Facts table links to dimEvents on a compound key %_CourseDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tblFacts:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CourseRef&amp;amp;'-'&amp;amp;CourseDate&amp;amp;'-'&amp;amp;EmployeeRef as %_CourseRefDateEmp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CourseRef&amp;amp;'-'&amp;amp;CourseDate as %_CourseRefDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Employees' as MetricType&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; countEmployee as DataValue&lt;/P&gt;&lt;P&gt;Resident&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dimTraining&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate (tblFacts)&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Null() as %_CourseDateEmp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CourseRef&amp;amp;'-'&amp;amp;CourseDate as %_CourseRefDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Events' as MetricType,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; countEvent as DataValue&lt;/P&gt;&lt;P&gt;Resident&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dimEvents&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a 3 table data model. tblFacts associating with dimTraining on %_CourseRefDateEmp and tblFacts associating with dimEvents on %_CourseRefDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue I have is that when I filter for an Employee (the field existing in the dimTraining table) it filters tblFacts for the associated %_CourseRefDateEmp values. My expression "=Sum({&amp;lt;MetricType={Events}&amp;gt;}DataValue)" will return nothing as that key is loaded as Null() for the Events data (as it is at a different granularity).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is what's the best way to handle mixed granularity in a facts table in this instance? The main thing I need to get from this is being able to filter my events data in the facts table by employee selections.... i.e. if i select an employee ref I'd like to see how many events they have been booked on to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd prefer not to OuterJoin the 2 dimension tables if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help / advice appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Apr 2015 16:51:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-04-21T16:51:09Z</dc:date>
    <item>
      <title>Data Modelling Advice</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Modelling-Advice/m-p/877733#M659364</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;Could do with some data modelling advice for a QlikView data model with training data. I've not got access to the app right now so I can't copy the script or print screen the data model...so I'll have to explain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 tables - dimTraining and dimEvents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dimTraining: the lowest level in this table is CourseRef, CourseDate and EmployeeRef. This is a table of all the courses created over the days they run on. There is a countEmployee field which is a count of the records.&lt;/P&gt;&lt;P&gt;dimEvents: the lowest level in this table is CourseRef, CourseDate (just data on the events). This is a table of which employees are booked on each course by day. There is a countEvent field which is a count of the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;note: not all the CourseRef values in dimEvents exist in dimTraining, only once employees are booked on the course.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a Facts table using resident loads from these dimension tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Facts table links to dimTraining on a compound key %_CourseDateEmp&lt;/P&gt;&lt;P&gt;The Facts table links to dimEvents on a compound key %_CourseDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tblFacts:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CourseRef&amp;amp;'-'&amp;amp;CourseDate&amp;amp;'-'&amp;amp;EmployeeRef as %_CourseRefDateEmp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CourseRef&amp;amp;'-'&amp;amp;CourseDate as %_CourseRefDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Employees' as MetricType&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; countEmployee as DataValue&lt;/P&gt;&lt;P&gt;Resident&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dimTraining&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate (tblFacts)&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Null() as %_CourseDateEmp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CourseRef&amp;amp;'-'&amp;amp;CourseDate as %_CourseRefDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Events' as MetricType,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; countEvent as DataValue&lt;/P&gt;&lt;P&gt;Resident&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dimEvents&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a 3 table data model. tblFacts associating with dimTraining on %_CourseRefDateEmp and tblFacts associating with dimEvents on %_CourseRefDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue I have is that when I filter for an Employee (the field existing in the dimTraining table) it filters tblFacts for the associated %_CourseRefDateEmp values. My expression "=Sum({&amp;lt;MetricType={Events}&amp;gt;}DataValue)" will return nothing as that key is loaded as Null() for the Events data (as it is at a different granularity).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is what's the best way to handle mixed granularity in a facts table in this instance? The main thing I need to get from this is being able to filter my events data in the facts table by employee selections.... i.e. if i select an employee ref I'd like to see how many events they have been booked on to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd prefer not to OuterJoin the 2 dimension tables if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help / advice appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 16:51:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Modelling-Advice/m-p/877733#M659364</guid>
      <dc:creator />
      <dc:date>2015-04-21T16:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Data Modelling Advice</title>
      <link>https://community.qlik.com/t5/QlikView/Data-Modelling-Advice/m-p/877734#M659365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps this blog post helps: &lt;A _jive_internal="true" class="font-color-normal" href="https://community.qlik.com/blogs/qlikviewdesignblog/2012/10/26/mixed-granularity" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #3d3d3d;"&gt;Fact Table with Mixed Granularity&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 10:15:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Data-Modelling-Advice/m-p/877734#M659365</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-04-22T10:15:29Z</dc:date>
    </item>
  </channel>
</rss>

