<?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: Re: Re: Problem with multiple records when spliting data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536767#M200594</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found a solution to the problem. Thanks for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solution I found: by adding a column "employed" in the employee records, with a 1 in the month in which the employee starts and a 0 in the other months. Now I added an IF to the expression regarding the Employee.InServiceDate. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date.Valuefield&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;-(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Employed&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=1,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Employee.InServiceDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,))&amp;lt;29,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Value.Valuefield&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,0)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Aug 2013 08:16:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-08-28T08:16:13Z</dc:date>
    <item>
      <title>Problem with multiple records when spliting data</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536764#M200591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to split data depending on the time after the in service date of an employee. The problem I encounter when spliting the data is that I have more than one record with the in service date of an employee available and the split result is a multiple of the actual total data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data I want to split is available per employee and date. The total data is available with the simply expression =SUM(Value.Valuefield). When I use the expression =SUM(IF(Date.Valuefield-Employee.InServiceDate&amp;gt;=29,Value.Valuefield,0)) the total value per employee gets multiplier by the number of records with in service dates available for that employee, which is logical, but unwanted. Is there a way to use only one of the employee in service date per employee?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Available value record (Date.Valuefield, Value.Valuefield, Employee):&lt;/P&gt;&lt;P&gt;26-08-2013, 8, employee1&lt;/P&gt;&lt;P&gt;27-08-2013, 8, employee1&lt;/P&gt;&lt;P&gt;Available employee records with in service date (Employee, Employee.InServiceDate, Month):&lt;/P&gt;&lt;P&gt;employee1, 01-07-2013, July&lt;/P&gt;&lt;P&gt;employee1, 01-07-2013, August&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The simple sum expression results in 16&lt;/P&gt;&lt;P&gt;The expression which checks the in service date results in 32&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone an idea? Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 14:12:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536764#M200591</guid>
      <dc:creator />
      <dc:date>2013-08-27T14:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with multiple records when spliting data</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536765#M200592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raimund,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the attached QVW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Rajesh Vaswani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 14:23:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536765#M200592</guid>
      <dc:creator>rajeshvaswani77</dc:creator>
      <dc:date>2013-08-27T14:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Problem with multiple records when spliting data</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536766#M200593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reaction. I noticed my description is not clear enough. I have a lot of different employees, lots of Values I like to add up and also a lot of records per employee with the Inservice date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I adjusted the qvw a bit, perhaps that clearifies it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 14:37:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536766#M200593</guid>
      <dc:creator />
      <dc:date>2013-08-27T14:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Problem with multiple records when spliting data</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536767#M200594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found a solution to the problem. Thanks for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solution I found: by adding a column "employed" in the employee records, with a 1 in the month in which the employee starts and a 0 in the other months. Now I added an IF to the expression regarding the Employee.InServiceDate. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date.Valuefield&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;-(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Employed&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=1,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Employee.InServiceDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,))&amp;lt;29,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Value.Valuefield&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,0)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 08:16:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536767#M200594</guid>
      <dc:creator />
      <dc:date>2013-08-28T08:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with multiple records when spliting data</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536768#M200595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raimund,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I have had similar issues in that I have a lower level of granularity in my data than I need for a particular expression I have used peek and order by to give me an identifier for the distinct records that I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) First define your compound key i.e. employee &amp;amp; date in your case I think&lt;/P&gt;&lt;P&gt;2) Perform a resident load and order by your compound key&lt;/P&gt;&lt;P&gt;3) Use the peek function to check for each distinct occurrence of your compound key during the resident load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;Table 1:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field 1 &amp;amp; '-' &amp;amp; Field 2&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; as [%Compound Key],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field 1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field 2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field 3,&lt;/P&gt;&lt;P&gt;From xyz.qvd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [%Compound Key],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field 1, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field 2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field 3,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If([%Compound Key] = Peek('%Compound Key'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1)&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;&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; as _DistinctCompoundKey&lt;/P&gt;&lt;P&gt;Resident Table 1&lt;/P&gt;&lt;P&gt;Order By [%Compound Key];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way you can use set analysis expression to sum up and field only for the distinct occurrences of your compound key. i.e &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;_DistinctCompoundKey = {1}&amp;gt;}Field 3) or even&lt;/P&gt;&lt;P&gt;sum(_DistinctCompoundKey) depending on what you want to measure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe this is a more efficient way of accomplishing what you need as it won't consume as much resource when calculating.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 08:44:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536768#M200595</guid>
      <dc:creator />
      <dc:date>2013-08-28T08:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with multiple records when spliting data</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536769#M200596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Andy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your extra information!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raimund&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 09:04:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-multiple-records-when-spliting-data/m-p/536769#M200596</guid>
      <dc:creator />
      <dc:date>2013-08-28T09:04:52Z</dc:date>
    </item>
  </channel>
</rss>

