<?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 Modelling Question in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Data-Modelling-Question/m-p/2454446#M98296</link>
    <description>&lt;P&gt;Hmm. I think you could this with 2 methods. You could connect the table trough interval match. Or you could create both tables with a monthly record and create a key with ContractID and Month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But what do you want to do with the condition?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2024 07:30:58 GMT</pubDate>
    <dc:creator>JHuis</dc:creator>
    <dc:date>2024-05-21T07:30:58Z</dc:date>
    <item>
      <title>Data Modelling Question</title>
      <link>https://community.qlik.com/t5/App-Development/Data-Modelling-Question/m-p/2454437#M98294</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;i am facing the following challange: I have a table that contains contract data. Every contract can have multiple periods, i.e.:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Contract ID&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Valid Form&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Valid To&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;123&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;2023-01-01&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;2023-12-31&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;123&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;2024-01-01&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;2024-12-31&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;There are several other tables in the source system's database that contain the contract conditions. All records are structured the same way, i.e.:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;Conditition ID&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Contract ID&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;Valid From&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;Valid To&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;Condition&lt;/TD&gt;
&lt;TD width="12.5%"&gt;Type&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;ABC&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;123&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;2023-01-01&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;2023-07-13&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;120.000&lt;/TD&gt;
&lt;TD width="12.5%"&gt;Premium&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;ABC&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;123&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;2023-07-14&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;2024-12-31&lt;/TD&gt;
&lt;TD width="12.5%" height="25px"&gt;500.000&lt;/TD&gt;
&lt;TD width="12.5%"&gt;Premium&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;The business requirement here is to be able to answer questions such as "What is my premium for a given contract and month(-year) ?" In order to answer a question like this, i figure, i need first break down my contract records into one record per month (did that; works) and then (not sure how to approach this) i need to connect the conditions to the monthly records - but how ? (especially when you can have two conditions being valid in one month) ...&lt;/P&gt;
&lt;P&gt;Any help is much appreciated. Thanks in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 07:00:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-Modelling-Question/m-p/2454437#M98294</guid>
      <dc:creator>xyz_1011</dc:creator>
      <dc:date>2024-05-21T07:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Data Modelling Question</title>
      <link>https://community.qlik.com/t5/App-Development/Data-Modelling-Question/m-p/2454446#M98296</link>
      <description>&lt;P&gt;Hmm. I think you could this with 2 methods. You could connect the table trough interval match. Or you could create both tables with a monthly record and create a key with ContractID and Month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But what do you want to do with the condition?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 07:30:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-Modelling-Question/m-p/2454446#M98296</guid>
      <dc:creator>JHuis</dc:creator>
      <dc:date>2024-05-21T07:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Data Modelling Question</title>
      <link>https://community.qlik.com/t5/App-Development/Data-Modelling-Question/m-p/2454469#M98299</link>
      <description>&lt;P&gt;To answer questions like "What is my premium for a given contract and month-year?&lt;BR /&gt;By providing a structure where each month is linked to the relevant conditions, even if there are multiple conditions in a single month.&lt;BR /&gt;&lt;BR /&gt;For a specific month and year, use set analysis to filter the data accordingly. For example, to find the premium for contract 123 in March 2023:&lt;/P&gt;
&lt;P&gt;SUM({&amp;lt;ContractID={'123'}, Month={'Mar'}, Year={'2023'}&amp;gt;} Premium)&lt;BR /&gt;&lt;BR /&gt;you can use a combination of Qlik's data modeling capabilities and set analysis.&lt;/P&gt;
&lt;P&gt;// Assuming 'Contracts' is your monthly broken down contracts table&lt;BR /&gt;// and 'Conditions' is your conditions table&lt;/P&gt;
&lt;P&gt;// Master Calendar&lt;BR /&gt;Calendar:&lt;BR /&gt;LOAD Date(MinDate + IterNo() - 1) as Date&lt;BR /&gt;AUTOGENERATE 1 WHILE MinDate + IterNo() - 1 &amp;lt;= MaxDate;&lt;/P&gt;
&lt;P&gt;// IntervalMatch&lt;BR /&gt;IntervalMatch (Date)&lt;BR /&gt;LOAD DISTINCT Valid From, Valid To&lt;BR /&gt;RESIDENT Contracts;&lt;/P&gt;
&lt;P&gt;// Join the conditions to the matched intervals&lt;BR /&gt;LEFT JOIN (Calendar)&lt;BR /&gt;LOAD ConditionID, ContractID, Condition, Type&lt;BR /&gt;RESIDENT Conditions;&lt;/P&gt;
&lt;P&gt;// Now your Calendar table has fields for both contracts and conditions&lt;/P&gt;
&lt;P&gt;Above script is only for sample you can create as per your request.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;*** When applicable please mark the correct/appropriate replies as "solution". Please LIKE threads if the provided solution is helpful to. ***&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 08:08:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-Modelling-Question/m-p/2454469#M98299</guid>
      <dc:creator>TauseefKhan</dc:creator>
      <dc:date>2024-05-21T08:08:20Z</dc:date>
    </item>
  </channel>
</rss>

