<?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 Reformatting table based on historical data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196186#M56367</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your suggestion almost did the trick for me. Basically, I think this is a good way to solve my problem, so thanks a lot already!&lt;BR /&gt;In trying I ran into what I hope to be a minor problem.&lt;/P&gt;&lt;P&gt;When I try your suggestion, it comes up with the desired format, but every month is in my table approx 30 times over. (With the required Value by the way!). I only need that record one time obviously. I tried to put in a DISTINCT, but that didn't work out.&lt;/P&gt;&lt;P&gt;In my test table for Details I have 3 records with fields Employee, Startdate, EndDate and Value, like I stated, but there are more fields in reality. I'll pass them on to give you a complete overview. The first 5 fields are identical on each of the 3 records.&lt;/P&gt;&lt;P&gt;Employee_ID&lt;BR /&gt;Contractstartdate&lt;BR /&gt;CostCenter&lt;BR /&gt;FTE_number&lt;BR /&gt;ValueType (there are multiple values, but I've filtered on only one to make the mechanism work)&lt;BR /&gt;LogDate (date the value change was carried out)&lt;BR /&gt;LogMaand (month the value change was carried out)&lt;BR /&gt;LogYear (year the value change was carried out)&lt;BR /&gt;NewValue&lt;BR /&gt;OldValue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on how to solve this? (I did get the desired end table with a Details-1 name and solved that by renaming the fields for Employee_ID and Value so that it became a 'stand-alone' table.)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 27 Mar 2010 18:38:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-03-27T18:38:04Z</dc:date>
    <item>
      <title>Reformatting table based on historical data</title>
      <link>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196184#M56365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been trying to get to a solution for what I feel might be a common problem. My technical knowledge is a bit limited, so I might have missed the obvious..&lt;/P&gt;&lt;P&gt;What I have is a table with employees and certain values that are valid in periods, with a startdate and an enddate. A person might have multiple records in this table, for consecutive timeperiods: (date is dd-mm-yy)&lt;/P&gt;&lt;P&gt;EMPLOYEE_ID STARTDATE ENDDATE VALUE&lt;BR /&gt;101 01-06-2008 30-04-2009 1&lt;BR /&gt;101 01-05-2009 30-09-2009 0.9&lt;BR /&gt;101 01-10-2009 ... 0.95&lt;BR /&gt;The last record is in the current period, so it has no enddate. (We're talking about personnel FTE values btw..)&lt;/P&gt;&lt;P&gt;What I also have is an INLINE with Year/MonthNr for 2008, 01 until 2010,12.&lt;/P&gt;&lt;P&gt;What I want my endresult to be is a table like:&lt;/P&gt;&lt;P&gt;EMPLOYEE_ID YEAR MONTH VALUE&lt;BR /&gt;101 2009 3 1&lt;BR /&gt;101 2009 4 1&lt;BR /&gt;101 2009 5 0.9&lt;/P&gt;&lt;P&gt;I've only entered a small part, but every employee should have a record for each year and month in the mentioned period from 2008 until 2010, obviously with the correct Value placed in to it, based on the historical value table.&lt;/P&gt;&lt;P&gt;I've anyone could come up with useful suggestions, I'd be grateful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Mar 2010 16:05:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196184#M56365</guid>
      <dc:creator />
      <dc:date>2010-03-27T16:05:31Z</dc:date>
    </item>
    <item>
      <title>Reformatting table based on historical data</title>
      <link>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196185#M56366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd suggest using LOAD ... WHILE functionality. Something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;LOAD&lt;BR /&gt; EMPLOYEEID,&lt;BR /&gt; date(MonthStart(FromDate) + IterNo() - 1, 'MMM-YYYY') as Month,&lt;BR /&gt; Value&lt;BR /&gt;resident&lt;BR /&gt; Details&lt;BR /&gt;WHILE&lt;BR /&gt; MonthStart(FromDate) + IterNo() - 1 &amp;lt;= EndDate&lt;BR /&gt;;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Mar 2010 17:46:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196185#M56366</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-03-27T17:46:18Z</dc:date>
    </item>
    <item>
      <title>Reformatting table based on historical data</title>
      <link>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196186#M56367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your suggestion almost did the trick for me. Basically, I think this is a good way to solve my problem, so thanks a lot already!&lt;BR /&gt;In trying I ran into what I hope to be a minor problem.&lt;/P&gt;&lt;P&gt;When I try your suggestion, it comes up with the desired format, but every month is in my table approx 30 times over. (With the required Value by the way!). I only need that record one time obviously. I tried to put in a DISTINCT, but that didn't work out.&lt;/P&gt;&lt;P&gt;In my test table for Details I have 3 records with fields Employee, Startdate, EndDate and Value, like I stated, but there are more fields in reality. I'll pass them on to give you a complete overview. The first 5 fields are identical on each of the 3 records.&lt;/P&gt;&lt;P&gt;Employee_ID&lt;BR /&gt;Contractstartdate&lt;BR /&gt;CostCenter&lt;BR /&gt;FTE_number&lt;BR /&gt;ValueType (there are multiple values, but I've filtered on only one to make the mechanism work)&lt;BR /&gt;LogDate (date the value change was carried out)&lt;BR /&gt;LogMaand (month the value change was carried out)&lt;BR /&gt;LogYear (year the value change was carried out)&lt;BR /&gt;NewValue&lt;BR /&gt;OldValue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on how to solve this? (I did get the desired end table with a Details-1 name and solved that by renaming the fields for Employee_ID and Value so that it became a 'stand-alone' table.)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Mar 2010 18:38:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196186#M56367</guid>
      <dc:creator />
      <dc:date>2010-03-27T18:38:04Z</dc:date>
    </item>
    <item>
      <title>Reformatting table based on historical data</title>
      <link>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196187#M56368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess that it has something to do with the days and the months, since it is either 30 or 31 times. So I'll check on the date/month function and I think it will be alright then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Mar 2010 18:51:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196187#M56368</guid>
      <dc:creator />
      <dc:date>2010-03-27T18:51:57Z</dc:date>
    </item>
    <item>
      <title>Reformatting table based on historical data</title>
      <link>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196188#M56369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on your description, it looks like you have daily records in your table, and that values can change on the daily basis... It might be a bit more complex (I'm not sure how would you like to treat the changing values).&lt;/P&gt;&lt;P&gt;Load distinct should help get rid of the repetitive values. You might have to first load distinct Start Date and End Date for each contract, and only them use LOAD ... WHILE. The Value and how to treat it is another story...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Mar 2010 19:06:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196188#M56369</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-03-27T19:06:11Z</dc:date>
    </item>
    <item>
      <title>Reformatting table based on historical data</title>
      <link>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196189#M56370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think it's more complex, since whilst changes can be made on a daily basis, the reality is that all changes are for multi month periods. So we can use the month principle. I think I can just take your example and convert to year-month records instead of daily dates and I assume the WHILE thing can then be applied to a month in stead of a date? At least I'll be trying that. If I'm wrong here, please let me know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Mar 2010 19:14:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196189#M56370</guid>
      <dc:creator />
      <dc:date>2010-03-27T19:14:56Z</dc:date>
    </item>
    <item>
      <title>Reformatting table based on historical data</title>
      <link>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196190#M56371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got it to work using the handed principle but altering it for an AddMonths(FromDate, IterNo()-1). Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Mar 2010 22:52:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196190#M56371</guid>
      <dc:creator />
      <dc:date>2010-03-27T22:52:23Z</dc:date>
    </item>
    <item>
      <title>Reformatting table based on historical data</title>
      <link>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196191#M56372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, right!!! I totally forgot - AddMonths it is! Sorry about it!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Mar 2010 00:05:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reformatting-table-based-on-historical-data/m-p/196191#M56372</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-03-28T00:05:10Z</dc:date>
    </item>
  </channel>
</rss>

