<?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: Link 2 Facttables in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Link-2-Facttables/m-p/1931963#M76792</link>
    <description>&lt;P&gt;Create bridge table to a common calendar, as below&lt;/P&gt;
&lt;P&gt;IF you need more clarity,&amp;nbsp; please post some sample data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Employee:&lt;BR /&gt;Load &lt;BR /&gt;ID, Name, Company, dateofjoining, typeofemployee,periodofemployment,costcentre&lt;BR /&gt;,ID&amp;amp;'-'&amp;amp;Company as EmployeeKey&lt;BR /&gt;From employeedata;&lt;/P&gt;
&lt;P&gt;Payslip:&lt;BR /&gt;Load ID, wages,workedhours, ID&amp;amp;'-'&amp;amp;Company&amp;amp;'-'&amp;amp;PayDate as PayslipKey&lt;BR /&gt;From payslipdata;&lt;/P&gt;
&lt;P&gt;Bridge:&lt;BR /&gt;Load ID,EmployeeKey,dateofjoining as DATE,'JoiningDate' as DateType&lt;BR /&gt;Resident Employee;&lt;BR /&gt;Concatenate(Bridge)&lt;BR /&gt;Load ID,PayslipKey,PayDate as DATE,'PayDate' as DateType&lt;BR /&gt;Resident Payslip;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Drop field ID from Payslip;&lt;/P&gt;
&lt;P&gt;MasterCalendar: &lt;BR /&gt;Load &lt;BR /&gt;TempDate AS DATE, &lt;BR /&gt;week(TempDate) As Week, &lt;BR /&gt;Year(TempDate) As Year, &lt;BR /&gt;Month(TempDate) As Month, &lt;BR /&gt;Day(TempDate) As Day, &lt;BR /&gt;'Q' &amp;amp; ceil(month(TempDate) / 3) AS Quarter, &lt;BR /&gt;Week(weekstart(TempDate)) &amp;amp; '-' &amp;amp; WeekYear(TempDate) as WeekYear, &lt;BR /&gt;WeekDay(TempDate) as WeekDay &lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;//=== Generate a temp table of dates === &lt;BR /&gt;LOAD &lt;BR /&gt;date(mindate + IterNo()) AS TempDate&lt;BR /&gt;,maxdate // Used in InYearToDate() above, but not kept &lt;BR /&gt;WHILE mindate + IterNo() &amp;lt;= maxdate;&lt;/P&gt;
&lt;P&gt;//=== Get min/max dates from Field ===/&lt;BR /&gt;LOAD&lt;BR /&gt;min(FieldValue('DATE', recno()))-1 as mindate,&lt;BR /&gt;max(FieldValue('DATE', recno())) as maxdate&lt;BR /&gt;AUTOGENERATE FieldValueCount('DATE');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;exit Script;&lt;/P&gt;</description>
    <pubDate>Tue, 17 May 2022 17:16:51 GMT</pubDate>
    <dc:creator>vinieme12</dc:creator>
    <dc:date>2022-05-17T17:16:51Z</dc:date>
    <item>
      <title>Link 2 Facttables</title>
      <link>https://community.qlik.com/t5/App-Development/Link-2-Facttables/m-p/1931759#M76780</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am not coming up with the solution how to correctly connect a second facts table (payslip) with my previous master facts table. i am trying to stay in the Star-SChema. Namely, for the selection of tab 1 "employee core data", I would like to get the corresponding wages/salaries/hours or similar displayed. However, I can only link the two tables with one field.&lt;/P&gt;
&lt;P&gt;If I link "MonthYear" I get the salary total for all companies.&lt;BR /&gt;If I link the PersonalID I get all salaries over all companies and each period as result.&lt;/P&gt;
&lt;P&gt;To get the correct result from "Playlsip" I need about 5 selections from tab 1. It is only the linking of date, but also of wage type or also company.&lt;/P&gt;
&lt;P&gt;The tables can not be JOINTed together, because the amount of data is too big.&lt;/P&gt;
&lt;P&gt;Examples:&lt;/P&gt;
&lt;P&gt;Main Tab 1: employee core data&lt;/P&gt;
&lt;P&gt;ID, Name, Company, date of joining, type of employe, period of employment, monthyear, cost centre etc.&lt;/P&gt;
&lt;P&gt;(How much workers i had MonthYear? How much were sick? Which type of employe i had when)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tab 2: Payslip&lt;/P&gt;
&lt;P&gt;ID, Name, Company Type of employe, motnyear, cost centre, wages, worked hours etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do i need a unique ID that contains each selection? OR i have to Concatonate the Tables? &lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 13:30:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Link-2-Facttables/m-p/1931759#M76780</guid>
      <dc:creator>Seier-Alsenz</dc:creator>
      <dc:date>2022-05-17T13:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Link 2 Facttables</title>
      <link>https://community.qlik.com/t5/App-Development/Link-2-Facttables/m-p/1931813#M76784</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You can't link the two tables with the two keys? By creating a compound key&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 14:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Link-2-Facttables/m-p/1931813#M76784</guid>
      <dc:creator>lukas_</dc:creator>
      <dc:date>2022-05-17T14:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Link 2 Facttables</title>
      <link>https://community.qlik.com/t5/App-Development/Link-2-Facttables/m-p/1931963#M76792</link>
      <description>&lt;P&gt;Create bridge table to a common calendar, as below&lt;/P&gt;
&lt;P&gt;IF you need more clarity,&amp;nbsp; please post some sample data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Employee:&lt;BR /&gt;Load &lt;BR /&gt;ID, Name, Company, dateofjoining, typeofemployee,periodofemployment,costcentre&lt;BR /&gt;,ID&amp;amp;'-'&amp;amp;Company as EmployeeKey&lt;BR /&gt;From employeedata;&lt;/P&gt;
&lt;P&gt;Payslip:&lt;BR /&gt;Load ID, wages,workedhours, ID&amp;amp;'-'&amp;amp;Company&amp;amp;'-'&amp;amp;PayDate as PayslipKey&lt;BR /&gt;From payslipdata;&lt;/P&gt;
&lt;P&gt;Bridge:&lt;BR /&gt;Load ID,EmployeeKey,dateofjoining as DATE,'JoiningDate' as DateType&lt;BR /&gt;Resident Employee;&lt;BR /&gt;Concatenate(Bridge)&lt;BR /&gt;Load ID,PayslipKey,PayDate as DATE,'PayDate' as DateType&lt;BR /&gt;Resident Payslip;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Drop field ID from Payslip;&lt;/P&gt;
&lt;P&gt;MasterCalendar: &lt;BR /&gt;Load &lt;BR /&gt;TempDate AS DATE, &lt;BR /&gt;week(TempDate) As Week, &lt;BR /&gt;Year(TempDate) As Year, &lt;BR /&gt;Month(TempDate) As Month, &lt;BR /&gt;Day(TempDate) As Day, &lt;BR /&gt;'Q' &amp;amp; ceil(month(TempDate) / 3) AS Quarter, &lt;BR /&gt;Week(weekstart(TempDate)) &amp;amp; '-' &amp;amp; WeekYear(TempDate) as WeekYear, &lt;BR /&gt;WeekDay(TempDate) as WeekDay &lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;//=== Generate a temp table of dates === &lt;BR /&gt;LOAD &lt;BR /&gt;date(mindate + IterNo()) AS TempDate&lt;BR /&gt;,maxdate // Used in InYearToDate() above, but not kept &lt;BR /&gt;WHILE mindate + IterNo() &amp;lt;= maxdate;&lt;/P&gt;
&lt;P&gt;//=== Get min/max dates from Field ===/&lt;BR /&gt;LOAD&lt;BR /&gt;min(FieldValue('DATE', recno()))-1 as mindate,&lt;BR /&gt;max(FieldValue('DATE', recno())) as maxdate&lt;BR /&gt;AUTOGENERATE FieldValueCount('DATE');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;exit Script;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 17:16:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Link-2-Facttables/m-p/1931963#M76792</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2022-05-17T17:16:51Z</dc:date>
    </item>
  </channel>
</rss>

