<?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 Combine value only once with another value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Combine-value-only-once-with-another-value/m-p/1011232#M955626</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to reduce a table by combining two lines into one where there is a connection. I have the following data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Id, Next, Begin, End&lt;/P&gt;&lt;P&gt;1, 2, 08:30, 10:00&lt;/P&gt;&lt;P&gt;1, 2, 15:20, 16:40&lt;/P&gt;&lt;P&gt;2, , 17:00, 18:30,&lt;/P&gt;&lt;P&gt;2, , 19:20, 21:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each entry in "next" has exactly ONE corresponding in "id", for example the the first and the third line belong together and the second and the forth. The minimal difference between the end-time of the first and the begin time of the second makes clear, which entry must be picked if one id occurs several times. But one value should only be connected once, so line 1 has a waiting time of 7 hours before line 3 begins. and though there is only a difference of 20 minutes between line 2 and 3, line 3 could not be used a second time and instead there is a waiting time of 2 hours and 40 minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but right now i could not restrict it that way and therefore line 3 is connected to line 1 and line 2 which i do not intend.&lt;/P&gt;&lt;P&gt;can anyone help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Nov 2015 12:01:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-11-17T12:01:09Z</dc:date>
    <item>
      <title>Combine value only once with another value</title>
      <link>https://community.qlik.com/t5/QlikView/Combine-value-only-once-with-another-value/m-p/1011232#M955626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to reduce a table by combining two lines into one where there is a connection. I have the following data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Id, Next, Begin, End&lt;/P&gt;&lt;P&gt;1, 2, 08:30, 10:00&lt;/P&gt;&lt;P&gt;1, 2, 15:20, 16:40&lt;/P&gt;&lt;P&gt;2, , 17:00, 18:30,&lt;/P&gt;&lt;P&gt;2, , 19:20, 21:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each entry in "next" has exactly ONE corresponding in "id", for example the the first and the third line belong together and the second and the forth. The minimal difference between the end-time of the first and the begin time of the second makes clear, which entry must be picked if one id occurs several times. But one value should only be connected once, so line 1 has a waiting time of 7 hours before line 3 begins. and though there is only a difference of 20 minutes between line 2 and 3, line 3 could not be used a second time and instead there is a waiting time of 2 hours and 40 minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but right now i could not restrict it that way and therefore line 3 is connected to line 1 and line 2 which i do not intend.&lt;/P&gt;&lt;P&gt;can anyone help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 12:01:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Combine-value-only-once-with-another-value/m-p/1011232#M955626</guid>
      <dc:creator />
      <dc:date>2015-11-17T12:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Combine value only once with another value</title>
      <link>https://community.qlik.com/t5/QlikView/Combine-value-only-once-with-another-value/m-p/1011233#M955627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14478042542042232" jivemacro_uid="_14478042542042232"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;[Data]:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Id, Next, Begin, End&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 2, 08:30, 10:00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 2, 15:20, 16:40&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, , 17:00, 18:30&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, , 19:20, 21:00&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;[Temp_Combine]:&lt;/P&gt;
&lt;P&gt;LOAD Id as TId,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; End as TEnd,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Next as TCId&lt;/P&gt;
&lt;P&gt;RESIDENT [Data];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LEFT JOIN([Temp_Combine])&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Id as TCId,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Begin as TNextBegin&lt;/P&gt;
&lt;P&gt;RESIDENT [Data]&lt;/P&gt;
&lt;P&gt;WHERE EXISTS(Id);&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;[Temp_Difference]:&lt;/P&gt;
&lt;P&gt;LOAD TId,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; TEnd,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; TCId,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; TNextBegin,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If(IsNull(TCId), 0, Time(TNextBegin - TEnd, 'hh:mm')) as [Wait]&lt;/P&gt;
&lt;P&gt;RESIDENT [Temp_Combine]&lt;/P&gt;
&lt;P&gt;WHERE TNextBegin - TEnd &amp;gt;= 0;&lt;/P&gt;
&lt;P&gt;DROP TABLE [Temp_Combine];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;[Waiting]:&lt;/P&gt;
&lt;P&gt;LOAD TId, TEnd, TCId, TNextBegin, Wait, TEnd as Check1, TNextBegin as Check2&lt;/P&gt;
&lt;P&gt;RESIDENT [Temp_Difference]&lt;/P&gt;
&lt;P&gt;Where Not Exists(Check1, TEnd) and Not Exists(Check2, TNextBegin)&lt;/P&gt;
&lt;P&gt;Order by TId, TEnd, Wait;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;drop table [Temp_Difference];&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 23:51:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Combine-value-only-once-with-another-value/m-p/1011233#M955627</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-11-17T23:51:16Z</dc:date>
    </item>
  </channel>
</rss>

