<?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: convert rows to columns based on ID and Type in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841466#M295705</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14352738591585762 jive_text_macro" jivemacro_uid="_14352738591585762"&gt;
&lt;P&gt;tmp:&lt;/P&gt;
&lt;P&gt;load * inline [&lt;/P&gt;
&lt;P&gt;Id, First date , Last date, type&lt;/P&gt;
&lt;P&gt;1, 01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;
&lt;P&gt;1,01/May/2014, 05/May/2014,B&lt;/P&gt;
&lt;P&gt;1,10/May/2014,05/Jun/2014,C&lt;/P&gt;
&lt;P&gt;2, 02/Apr/2014, 04/Apr/2014, S&lt;/P&gt;
&lt;P&gt;2,03/May/2014, 05/May/2014,B&lt;/P&gt;
&lt;P&gt;2,15/May/2014,05/Jun/2014,C&lt;/P&gt;
&lt;P&gt;3, 01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;
&lt;P&gt;3,01/May/2014, 05/May/2014,B&lt;/P&gt;
&lt;P&gt;3,10/May/2014,05/Jun/2014,C&lt;/P&gt;
&lt;P&gt;](delimiter is ',');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set vLoadType = '';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; for TypeCounter = 1 to FieldValueCount('type')&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; let vType = FieldValue('type',$(TypeCounter));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Temp:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $(vLoadType)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; load &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Id,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; [First date] as [$(vType)_First date],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; [Last date] as [$(vType)_Last date]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; resident tmp&lt;/P&gt;
&lt;P&gt;&amp;nbsp; where type = '$(vType)' ;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set vLoadType = 'left join';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; next&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; drop table tmp;&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;P&gt;&lt;/P&gt;
&lt;P&gt;STORE Temp into temp.qvd(qvd);&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jun 2015 23:11:12 GMT</pubDate>
    <dc:creator>ramoncova06</dc:creator>
    <dc:date>2015-06-25T23:11:12Z</dc:date>
    <item>
      <title>convert rows to columns based on ID and Type</title>
      <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841464#M295703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have the SQL out put in the below format. Need to convert them into the rows for each id, Based on the type the column name changes and store them in a QVD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Id, First date , Last date, type&lt;/P&gt;&lt;P&gt;1, 01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;1,01/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;1,10/May/2014,05/Jun/2014,C&lt;/P&gt;&lt;P&gt;2, 02/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;2,03/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;2,15/May/2014,05/Jun/2014,C&lt;/P&gt;&lt;P&gt;3, 01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;3,01/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;3,10/May/2014,05/Jun/2014,C&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 546px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" style="border: 0px black; border-image: none;" width="37"&gt;&lt;STRONG style="color: #000000; font-family: Calibri;"&gt;ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;" width="78"&gt;&lt;STRONG style="color: #000000; font-family: Calibri;"&gt;S_first_date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;" width="67"&gt;&lt;STRONG style="color: #000000; font-family: Calibri;"&gt;S_last_date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;" width="78"&gt;&lt;STRONG style="color: #000000; font-family: Calibri;"&gt;B_first_date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;" width="73"&gt;&lt;STRONG style="color: #000000; font-family: Calibri;"&gt;B_last_date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;" width="79"&gt;&lt;STRONG style="color: #000000; font-family: Calibri;"&gt;C_first_date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;" width="134"&gt;&lt;STRONG style="color: #000000; font-family: Calibri;"&gt;C_last_date&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;1-Apr-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4-Apr-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;1-May-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;5-May-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;10-May-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;5-Jun-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;2-Apr-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4-Apr-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;3-May-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;5-May-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;15-May-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;5-Jun-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;1-Apr-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4-Apr-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;1-May-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;5-May-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;10-May-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;5-Jun-14&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks..&lt;/P&gt;&lt;P&gt;JJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jun 2015 03:44:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841464#M295703</guid>
      <dc:creator />
      <dc:date>2015-06-07T03:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: convert rows to columns based on ID and Type</title>
      <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841465#M295704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Converted:&lt;/P&gt;&lt;P&gt;LOAD Id,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [First date] as [S_first_date],&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Last date] as [S_last_date]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;RESIDENT Yourtable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;WHERE type = 'S';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;LEFT JOIN (Converted)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;LOAD Id,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [First date] as [B_first_date],&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Last date] as [B_last_date]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;RESIDENT Yourtable&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;WHERE type = 'B';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;LEFT JOIN (Converted)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;LOAD Id,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [First date] as [C_first_date],&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Last date] as [C_last_date]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;RESIDENT Yourtable&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;WHERE type = 'C';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;STORE Converted INTO Converted.qvd (qvd);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 22:34:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841465#M295704</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-06-25T22:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: convert rows to columns based on ID and Type</title>
      <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841466#M295705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another option&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14352738591585762 jive_text_macro" jivemacro_uid="_14352738591585762"&gt;
&lt;P&gt;tmp:&lt;/P&gt;
&lt;P&gt;load * inline [&lt;/P&gt;
&lt;P&gt;Id, First date , Last date, type&lt;/P&gt;
&lt;P&gt;1, 01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;
&lt;P&gt;1,01/May/2014, 05/May/2014,B&lt;/P&gt;
&lt;P&gt;1,10/May/2014,05/Jun/2014,C&lt;/P&gt;
&lt;P&gt;2, 02/Apr/2014, 04/Apr/2014, S&lt;/P&gt;
&lt;P&gt;2,03/May/2014, 05/May/2014,B&lt;/P&gt;
&lt;P&gt;2,15/May/2014,05/Jun/2014,C&lt;/P&gt;
&lt;P&gt;3, 01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;
&lt;P&gt;3,01/May/2014, 05/May/2014,B&lt;/P&gt;
&lt;P&gt;3,10/May/2014,05/Jun/2014,C&lt;/P&gt;
&lt;P&gt;](delimiter is ',');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set vLoadType = '';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; for TypeCounter = 1 to FieldValueCount('type')&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; let vType = FieldValue('type',$(TypeCounter));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Temp:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; $(vLoadType)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; load &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Id,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; [First date] as [$(vType)_First date],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; [Last date] as [$(vType)_Last date]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; resident tmp&lt;/P&gt;
&lt;P&gt;&amp;nbsp; where type = '$(vType)' ;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set vLoadType = 'left join';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; next&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; drop table tmp;&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;P&gt;&lt;/P&gt;
&lt;P&gt;STORE Temp into temp.qvd(qvd);&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2015 23:11:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841466#M295705</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-06-25T23:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: convert rows to columns based on ID and Type</title>
      <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841467#M295706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yet another way of getting a pivot(ed) table in a load script - which is an adaption of a tried and true method from SQL - and any other database/query language that can do aggregates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14352948121763322 jive_text_macro" jivemacro_uid="_14352948121763322" modifiedtitle="true"&gt;
&lt;P&gt;JOIN (DataInput)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;PIVOT_matrix:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;type, S_, B_, C_&lt;/P&gt;
&lt;P&gt;S, 1,0,0&lt;/P&gt;
&lt;P&gt;B, 0,1,0&lt;/P&gt;
&lt;P&gt;C, 0,0,1&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Data:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Id,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [First date] * S_ ) ) AS S_first_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [Last date]&amp;nbsp; * S_ ) ) AS S_last_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [First date] * B_ ) ) AS B_first_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [Last date]&amp;nbsp; * B_ ) ) AS B_last_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [First date] * C_ ) ) AS C_first_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [Last date]&amp;nbsp; * C_ ) ) AS C_last_date&lt;/P&gt;
&lt;P&gt;RESIDENT&amp;nbsp; DataInput&lt;/P&gt;
&lt;P&gt;GROUP BY&amp;nbsp; Id;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;STORE Data INTO Converted.QVD (QVD);&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 05:01:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841467#M295706</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-06-26T05:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: convert rows to columns based on ID and Type</title>
      <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841468#M295707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A fourth variant which I am pretty sure is more efficient than my first suggestion - by not using joins and not relying on a resident table - just use preceding loads:&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_14352966250451999" jivemacro_uid="_14352966250451999"&gt;
&lt;P&gt;Data:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Id,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [First date] * S_ ) ) AS S_first_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [Last date]&amp;nbsp; * S_ ) ) AS S_last_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [First date] * B_ ) ) AS B_first_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [Last date]&amp;nbsp; * B_ ) ) AS B_last_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [First date] * C_ ) ) AS C_first_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( [Last date]&amp;nbsp; * C_ ) ) AS C_last_date&lt;/P&gt;
&lt;P&gt;GROUP BY Id;&lt;/P&gt;
&lt;P&gt;LOAD *, -(type='S') AS S_, -(type='B') AS B_, -(type='C') AS C_;&lt;/P&gt;
&lt;P&gt;SQL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT Id,[First date],[Last date],type FROM SourceTable;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;STORE Data INTO Converted.QVD (QVD);&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 05:30:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841468#M295707</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-06-26T05:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: convert rows to columns based on ID and Type</title>
      <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841469#M295708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry - I overcomplicate things a little bit - this is the simplest solution I can come up with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1435297908536613 jive_text_macro" jivemacro_uid="_1435297908536613" modifiedtitle="true"&gt;
&lt;P&gt;Data:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Id,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( If( type='S' , [First date]) )) AS S_first_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( If( type='S' , [Last date])&amp;nbsp; )) AS S_last_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( If( type='B' , [First date]) )) AS B_first_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( If( type='B' , [Last date])&amp;nbsp; )) AS B_last_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( If( type='C' , [First date]) )) AS C_first_date,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date( Sum( If( type='C' , [Last date])&amp;nbsp; )) AS C_last_date&lt;/P&gt;
&lt;P&gt;GROUP BY Id;&lt;/P&gt;
&lt;P&gt;SQL SELECT Id,[First date],[Last date],type FROM SourceTable;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 05:53:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841469#M295708</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-06-26T05:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: convert rows to columns based on ID and Type</title>
      <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841470#M295709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think using Sum() might not be the best aggregation function although it works perfectly well for this case and consistent data. LastValue() or Concat() is probably much better to get a more fail-proof result even with multiple values returned.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 06:06:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841470#M295709</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-06-26T06:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: convert rows to columns based on ID and Type</title>
      <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841471#M295710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jgonweb,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;Main:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;LOAD&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; Id,&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( &lt;/SPAN&gt;&lt;SPAN class="func" style="font-weight: inherit; font-style: inherit; color: #ff1493; font-size: 9pt !important; background-color: inherit;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( If( type=&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'S'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; , [&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;First&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]) )) &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; S_first_date,&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( &lt;/SPAN&gt;&lt;SPAN class="func" style="font-weight: inherit; font-style: inherit; color: #ff1493; font-size: 9pt !important; background-color: inherit;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( If( type=&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'S'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; , [&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Last&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;])&amp;nbsp; )) &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; S_last_date,&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( &lt;/SPAN&gt;&lt;SPAN class="func" style="font-weight: inherit; font-style: inherit; color: #ff1493; font-size: 9pt !important; background-color: inherit;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( If( type=&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'B'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; , [&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;First&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]) )) &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; B_first_date,&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( &lt;/SPAN&gt;&lt;SPAN class="func" style="font-weight: inherit; font-style: inherit; color: #ff1493; font-size: 9pt !important; background-color: inherit;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( If( type=&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'B'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; , [&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Last&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;])&amp;nbsp; )) &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; B_last_date,&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( &lt;/SPAN&gt;&lt;SPAN class="func" style="font-weight: inherit; font-style: inherit; color: #ff1493; font-size: 9pt !important; background-color: inherit;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( If( type=&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'C'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; , [&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;First&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]) )) &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; C_first_date,&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp; &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( &lt;/SPAN&gt;&lt;SPAN class="func" style="font-weight: inherit; font-style: inherit; color: #ff1493; font-size: 9pt !important; background-color: inherit;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;( If( type=&lt;/SPAN&gt;&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;'C'&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; , [&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Last&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;])&amp;nbsp; )) &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; C_last_date&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;GROUP&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; Id;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;SQL &lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; Id,[&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;First&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;],[&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;Last&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;],type &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; Table;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt !important; font-style: inherit; background-color: inherit; font-weight: inherit;"&gt;Ramya.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 06:07:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841471#M295710</guid>
      <dc:creator />
      <dc:date>2015-06-26T06:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: convert rows to columns based on ID and Type</title>
      <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841472#M295711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Id,&lt;/P&gt;&lt;P&gt;Date(Date#([First date], 'DD/MMM/YYYY') , 'DD/MMM/YYYY')AS FirstDate,&lt;/P&gt;&lt;P&gt;Date(Date#([Last date], 'DD/MMM/YYYY'), 'DD/MMM/YYYY') AS LastDate, &lt;/P&gt;&lt;P&gt;type&lt;/P&gt;&lt;P&gt;INLINE [ &lt;/P&gt;&lt;P&gt;Id, First date , Last date, type&lt;/P&gt;&lt;P&gt;1, 01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;1,01/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;1,10/May/2014,05/Jun/2014,C&lt;/P&gt;&lt;P&gt;2, 02/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;2,03/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;2,15/May/2014,05/Jun/2014,C&lt;/P&gt;&lt;P&gt;3, 01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;3,01/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;3,10/May/2014,05/Jun/2014,C];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Id,&lt;/P&gt;&lt;P&gt;FirstDate AS S_FirstDate,&lt;/P&gt;&lt;P&gt;LastDate AS S_LastDate&lt;/P&gt;&lt;P&gt;RESIDENT Temp&lt;/P&gt;&lt;P&gt;WHERE type = 'S';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Data)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Id,&lt;/P&gt;&lt;P&gt;FirstDate AS B_FirstDate,&lt;/P&gt;&lt;P&gt;LastDate AS B_LastDate&lt;/P&gt;&lt;P&gt;RESIDENT Temp&lt;/P&gt;&lt;P&gt;WHERE type = 'B';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Data)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Id,&lt;/P&gt;&lt;P&gt;FirstDate AS C_FirstDate,&lt;/P&gt;&lt;P&gt;LastDate AS C_LastDate&lt;/P&gt;&lt;P&gt;RESIDENT Temp&lt;/P&gt;&lt;P&gt;WHERE type = 'C';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 06:27:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841472#M295711</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-06-26T06:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: convert rows to columns based on ID and Type</title>
      <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841473#M295712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try it in a single statement like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Id,&lt;/P&gt;&lt;P&gt;Date(Date#([First date], 'DD/MMM/YYYY') , 'DD/MMM/YYYY')AS FirstDate,&lt;/P&gt;&lt;P&gt;Date(Date#([Last date], 'DD/MMM/YYYY'), 'DD/MMM/YYYY') AS LastDate, &lt;/P&gt;&lt;P&gt;type&lt;/P&gt;&lt;P&gt;INLINE [ &lt;/P&gt;&lt;P&gt;Id, First date , Last date, type&lt;/P&gt;&lt;P&gt;1, 01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;1,01/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;1,10/May/2014,05/Jun/2014,C&lt;/P&gt;&lt;P&gt;2, 02/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;2,03/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;2,15/May/2014,05/Jun/2014,C&lt;/P&gt;&lt;P&gt;3, 01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;3,01/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;3,10/May/2014,05/Jun/2014,C];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; Id, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Date( Sum( If( type='S' , FirstDate) )) AS S_first_date, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Date( Sum( If( type='S' , LastDate)&amp;nbsp; )) AS S_last_date, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Date( Sum( If( type='B' , FirstDate) )) AS B_first_date, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Date( Sum( If( type='B' , LastDate)&amp;nbsp; )) AS B_last_date, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Date( Sum( If( type='C' , FirstDate) )) AS C_first_date, &lt;/P&gt;&lt;P&gt;&amp;nbsp; Date( Sum( If( type='C' , LastDate)&amp;nbsp; )) AS C_last_date &lt;/P&gt;&lt;P&gt; Resident Temp&lt;/P&gt;&lt;P&gt;GROUP BY Id; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE Temp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 06:30:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841473#M295712</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-06-26T06:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: convert rows to columns based on ID and Type</title>
      <link>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841474#M295713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;X:&lt;/P&gt;&lt;P&gt;Load * INLINE [&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Id, First date , Last date, type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1,01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1,01/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1,10/May/2014,05/Jun/2014,C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2,02/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2,03/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2,15/May/2014,05/Jun/2014,C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3,01/Apr/2014, 04/Apr/2014, S&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3,01/May/2014, 05/May/2014,B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3,10/May/2014,05/Jun/2014,C];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Id ,&lt;/P&gt;&lt;P&gt;Date(Sum(If(type='S',Date#([First date], 'DD/MMM/YYYY'))),'D-MMM-YYYY') AS S_first_date,&lt;/P&gt;&lt;P&gt;Date(Sum(If(type='S',Date#([Last date], 'DD/MMM/YYYY'))),'D-MMM-YYYY') AS S_last_date,&lt;/P&gt;&lt;P&gt;Date(Sum(If(type='B',Date#([First date], 'DD/MMM/YYYY'))),'D-MMM-YYYY') AS B_first_date,&lt;/P&gt;&lt;P&gt;Date(Sum(If(type='B',Date#([Last date], 'DD/MMM/YYYY'))),'D-MMM-YYYY') AS B_last_date,&lt;/P&gt;&lt;P&gt;Date(Sum(If(type='C',Date#([First date], 'DD/MMM/YYYY'))),'D-MMM-YYYY') AS C_first_date,&lt;/P&gt;&lt;P&gt;Date(Sum(If(type='C',Date#([Last date], 'DD/MMM/YYYY'))),'D-MMM-YYYY') AS C_last_date&lt;/P&gt;&lt;P&gt;Resident X&lt;/P&gt;&lt;P&gt;Group By Id ;&lt;/P&gt;&lt;P&gt;STORE Data into Data.qvd(qvd);&lt;/P&gt;&lt;P&gt;DROP TABLE X;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/90965_Untitled.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2015 10:47:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/convert-rows-to-columns-based-on-ID-and-Type/m-p/841474#M295713</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2015-06-26T10:47:35Z</dc:date>
    </item>
  </channel>
</rss>

