<?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: how to fill table from other table with request (SQL?) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/how-to-fill-table-from-other-table-with-request-SQL/m-p/339379#M125213</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tested by SQL and that's run.&lt;/P&gt;&lt;P&gt;But datas comes from excel sheet, so i can't use SQL command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How i can change this SQL request to Qlikview request?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the table is TEST, ans the fileds are id, statut, begin_date&amp;nbsp; and datfin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;select id, statut, begin_date, case when test.statut = 'Closed' then test.begin_date else nvl((select min(table1.begin_date) from TEST table1 where table1.begin_date &amp;gt; TEST.begin_date and table1.id=test.id),SYSDATE) end as datfin from TEST;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jul 2012 13:15:45 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-07-09T13:15:45Z</dc:date>
    <item>
      <title>how to fill table from other table with request (SQL?)</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-fill-table-from-other-table-with-request-SQL/m-p/339376#M125210</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 some help for a basic thing I don't know yet. &lt;/P&gt;&lt;P&gt;I'm sure it's very simple for many of yours and you ll be able to save me &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Stéphane&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a table with theses fields :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID;Statut;Begin-date&lt;/P&gt;&lt;P&gt;123;Open;01/01/2012&lt;/P&gt;&lt;P&gt;123;Work in progress;02/02/2012&lt;/P&gt;&lt;P&gt;123;Affected to MA;03/03/2012&lt;/P&gt;&lt;P&gt;77;Open;01/01/2012&lt;/P&gt;&lt;P&gt;77;Work in progress;02/02/2012&lt;/P&gt;&lt;P&gt;77;Affected to MA;03/03/2012&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to fill the end date with the begin date of the line which has the same ID&amp;nbsp; and the following date. If there are no line, the end date in now (date of loading data), and if the statut if = 'closed', the endèdate = begin date.&lt;/P&gt;&lt;P&gt;For example, the first line will have the end date of the second line (02/02/2012)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like that :&lt;/P&gt;&lt;P&gt;ID;Statut;Begin-date; end_date&lt;/P&gt;&lt;P&gt;123;Open;01/01/2012;02/02/2012&lt;/P&gt;&lt;P&gt;123;Work in progress;02/02/2012;03/03/2012&lt;/P&gt;&lt;P&gt;123;Affected to MA;03/03/2012; now()&lt;/P&gt;&lt;P&gt;77;Open;01/01/2012;02/02/2012&lt;/P&gt;&lt;P&gt;77;Work in progress;02/02/2012;03/03/2012&lt;/P&gt;&lt;P&gt;77;Affected to MA;03/03/2012: now()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a second table which has only one line per ID, and i would like to fill somme fields with the values of the first table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example, we have only two lines : 123 &amp;amp; 77 ID&lt;/P&gt;&lt;P&gt;The field current statut is the statut of the higher date of the first table for this ID&lt;/P&gt;&lt;P&gt;the begin date of the statut line of the first table which has the value open is put in the "Begin-date of open statut" of this second table&lt;/P&gt;&lt;P&gt;the begin date of the statut line of the first table which has the value closed is put in the "Begin-date of closed statut" of this second table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID;current_Statut;Begin-date of open statut; Begin-date of closed statut&lt;/P&gt;&lt;P&gt;123 ;Affected to MA ; 01/01/2012&lt;/P&gt;&lt;P&gt;77;Affected to MA ; 01/01/2012&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jul 2012 15:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-fill-table-from-other-table-with-request-SQL/m-p/339376#M125210</guid>
      <dc:creator />
      <dc:date>2012-07-07T15:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to fill table from other table with request (SQL?)</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-fill-table-from-other-table-with-request-SQL/m-p/339377#M125211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached is a solution. The script used in this solution is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;Data:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;LOAD * Inline [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;ID,Statut,Begin_date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;123,Open,01/01/2012&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;123,Work in progress,02/02/2012&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;123,Affected to MA,03/03/2012&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;77,Open,01/01/2012&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;77,Work in progress,02/02/2012&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;77,Affected to MA,03/03/2012&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;Table1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;NoConcatenate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;LOAD *,If(ID=Previous(ID),Previous(Begin_date),Date(Floor(Today()))) as End_date;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;LOAD * Resident Data Order by ID, Begin_date desc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;Drop Table Data;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;Data2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;LOAD ID&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;, FirstSortedValue(Statut,-Begin_date) as Current_Statut &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;, FirstSortedValue(Begin_date,Begin_date) as Begin_Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Resident Table1 Group By ID;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jul 2012 16:35:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-fill-table-from-other-table-with-request-SQL/m-p/339377#M125211</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2012-07-07T16:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to fill table from other table with request (SQL?)</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-fill-table-from-other-table-with-request-SQL/m-p/339378#M125212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Krishnamoorthy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your method seems to be very nice, butI have some difficulties to unterstand it and to put it in my work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you take few minutes to make two examples in my document, in order to learn it and after i will make my own job for all others fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="loading" href="http://www.hist-europe.fr/liens/test2.qvw"&gt;http://www.hist-europe.fr/liens/test2.qvw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the two examples are theses one :&lt;/P&gt;&lt;P&gt;- the field [Etat en cours] from &lt;SPAN style="font-size: 8pt;"&gt;Neworigine table has to be filled by the statut value of the table origine &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;for the higher date_changement of the date origine for the same id &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;- the field date fin of table origine &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; is fill by the field date_changement of the table origine for the following date_changement for the same id&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stéphane&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jul 2012 18:33:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-fill-table-from-other-table-with-request-SQL/m-p/339378#M125212</guid>
      <dc:creator />
      <dc:date>2012-07-07T18:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to fill table from other table with request (SQL?)</title>
      <link>https://community.qlik.com/t5/QlikView/how-to-fill-table-from-other-table-with-request-SQL/m-p/339379#M125213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tested by SQL and that's run.&lt;/P&gt;&lt;P&gt;But datas comes from excel sheet, so i can't use SQL command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How i can change this SQL request to Qlikview request?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the table is TEST, ans the fileds are id, statut, begin_date&amp;nbsp; and datfin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;select id, statut, begin_date, case when test.statut = 'Closed' then test.begin_date else nvl((select min(table1.begin_date) from TEST table1 where table1.begin_date &amp;gt; TEST.begin_date and table1.id=test.id),SYSDATE) end as datfin from TEST;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2012 13:15:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-to-fill-table-from-other-table-with-request-SQL/m-p/339379#M125213</guid>
      <dc:creator />
      <dc:date>2012-07-09T13:15:45Z</dc:date>
    </item>
  </channel>
</rss>

