<?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 Transpose and mapping rows to columns in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Transpose-and-mapping-rows-to-columns/m-p/2285046#M58668</link>
    <description>&lt;P&gt;hi&amp;nbsp;community,&lt;/P&gt; 
&lt;P&gt;i'm stuck now, i need to transpose and mapping my sum result, i already build my job like this, one for sum column TOTAL_AMOUNT, and another one for count&amp;nbsp;&lt;SPAN&gt;column&lt;/SPAN&gt; TOTAL_AMOUNT&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 493px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0Fi.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128620i95BB99A93A4C6998/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0Fi.png" alt="0683p000009M0Fi.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;and this my job result for sum_process&lt;/P&gt; 
&lt;TABLE&gt; 
 &lt;TBODY&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;ID&lt;/TD&gt; 
   &lt;TD&gt;Month&lt;/TD&gt; 
   &lt;TD&gt;categories&lt;/TD&gt; 
   &lt;TD&gt;total_amount&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130011&lt;/TD&gt; 
   &lt;TD&gt;01&lt;/TD&gt; 
   &lt;TD&gt;ELECTRONICS&lt;/TD&gt; 
   &lt;TD&gt;4313000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130011&lt;/TD&gt; 
   &lt;TD&gt;02&lt;/TD&gt; 
   &lt;TD&gt;ELECTRONICS&lt;/TD&gt; 
   &lt;TD&gt;2514000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130011&lt;/TD&gt; 
   &lt;TD&gt;01&lt;/TD&gt; 
   &lt;TD&gt;SUPERMARKET&lt;/TD&gt; 
   &lt;TD&gt;230640&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130011&lt;/TD&gt; 
   &lt;TD&gt;01&lt;/TD&gt; 
   &lt;TD&gt;RESTAURANT&lt;/TD&gt; 
   &lt;TD&gt;84000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130012&lt;/TD&gt; 
   &lt;TD&gt;01&lt;/TD&gt; 
   &lt;TD&gt;ELECTRONICS&lt;/TD&gt; 
   &lt;TD&gt;76000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130012&lt;/TD&gt; 
   &lt;TD&gt;01&lt;/TD&gt; 
   &lt;TD&gt;SUPERMARKET&lt;/TD&gt; 
   &lt;TD&gt;321000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130012&lt;/TD&gt; 
   &lt;TD&gt;02&lt;/TD&gt; 
   &lt;TD&gt;SUPERMARKET&lt;/TD&gt; 
   &lt;TD&gt;211000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130012&lt;/TD&gt; 
   &lt;TD&gt;02&lt;/TD&gt; 
   &lt;TD&gt;RESTAURANT&lt;/TD&gt; 
   &lt;TD&gt;16029200&lt;/TD&gt; 
  &lt;/TR&gt; 
 &lt;/TBODY&gt; 
&lt;/TABLE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;then i&amp;nbsp;&lt;SPAN&gt;want to transform it to something like :&lt;/SPAN&gt;&lt;/P&gt; 
&lt;TABLE&gt; 
 &lt;TBODY&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;ID&lt;/TD&gt; 
   &lt;TD&gt;ELECTRONICS_MONTH_01&lt;/TD&gt; 
   &lt;TD&gt;ELECTRONICS_MONTH_02&lt;/TD&gt; 
   &lt;TD&gt;SUPERMARKET_MONTH_01&lt;/TD&gt; 
   &lt;TD&gt;SUPERMARKET_MONTH_02&lt;/TD&gt; 
   &lt;TD&gt;RESTAURANT_MONTH_01&lt;/TD&gt; 
   &lt;TD&gt;RESTAURANT_MONTH_02&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130011&lt;/TD&gt; 
   &lt;TD&gt;4313000&lt;/TD&gt; 
   &lt;TD&gt;2514000&lt;/TD&gt; 
   &lt;TD&gt;230640&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
   &lt;TD&gt;84000&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130012&lt;/TD&gt; 
   &lt;TD&gt;76000&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
   &lt;TD&gt;321000&lt;/TD&gt; 
   &lt;TD&gt;211000&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
   &lt;TD&gt;16029200&lt;/TD&gt; 
  &lt;/TR&gt; 
 &lt;/TBODY&gt; 
&lt;/TABLE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please let me know if anyone has resolved this on.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&amp;nbsp;Jackson&lt;/P&gt;</description>
    <pubDate>Fri, 14 Sep 2018 06:14:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-09-14T06:14:57Z</dc:date>
    <item>
      <title>Transpose and mapping rows to columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transpose-and-mapping-rows-to-columns/m-p/2285046#M58668</link>
      <description>&lt;P&gt;hi&amp;nbsp;community,&lt;/P&gt; 
&lt;P&gt;i'm stuck now, i need to transpose and mapping my sum result, i already build my job like this, one for sum column TOTAL_AMOUNT, and another one for count&amp;nbsp;&lt;SPAN&gt;column&lt;/SPAN&gt; TOTAL_AMOUNT&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 493px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0Fi.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128620i95BB99A93A4C6998/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0Fi.png" alt="0683p000009M0Fi.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;and this my job result for sum_process&lt;/P&gt; 
&lt;TABLE&gt; 
 &lt;TBODY&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;ID&lt;/TD&gt; 
   &lt;TD&gt;Month&lt;/TD&gt; 
   &lt;TD&gt;categories&lt;/TD&gt; 
   &lt;TD&gt;total_amount&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130011&lt;/TD&gt; 
   &lt;TD&gt;01&lt;/TD&gt; 
   &lt;TD&gt;ELECTRONICS&lt;/TD&gt; 
   &lt;TD&gt;4313000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130011&lt;/TD&gt; 
   &lt;TD&gt;02&lt;/TD&gt; 
   &lt;TD&gt;ELECTRONICS&lt;/TD&gt; 
   &lt;TD&gt;2514000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130011&lt;/TD&gt; 
   &lt;TD&gt;01&lt;/TD&gt; 
   &lt;TD&gt;SUPERMARKET&lt;/TD&gt; 
   &lt;TD&gt;230640&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130011&lt;/TD&gt; 
   &lt;TD&gt;01&lt;/TD&gt; 
   &lt;TD&gt;RESTAURANT&lt;/TD&gt; 
   &lt;TD&gt;84000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130012&lt;/TD&gt; 
   &lt;TD&gt;01&lt;/TD&gt; 
   &lt;TD&gt;ELECTRONICS&lt;/TD&gt; 
   &lt;TD&gt;76000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130012&lt;/TD&gt; 
   &lt;TD&gt;01&lt;/TD&gt; 
   &lt;TD&gt;SUPERMARKET&lt;/TD&gt; 
   &lt;TD&gt;321000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130012&lt;/TD&gt; 
   &lt;TD&gt;02&lt;/TD&gt; 
   &lt;TD&gt;SUPERMARKET&lt;/TD&gt; 
   &lt;TD&gt;211000&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130012&lt;/TD&gt; 
   &lt;TD&gt;02&lt;/TD&gt; 
   &lt;TD&gt;RESTAURANT&lt;/TD&gt; 
   &lt;TD&gt;16029200&lt;/TD&gt; 
  &lt;/TR&gt; 
 &lt;/TBODY&gt; 
&lt;/TABLE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;then i&amp;nbsp;&lt;SPAN&gt;want to transform it to something like :&lt;/SPAN&gt;&lt;/P&gt; 
&lt;TABLE&gt; 
 &lt;TBODY&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;ID&lt;/TD&gt; 
   &lt;TD&gt;ELECTRONICS_MONTH_01&lt;/TD&gt; 
   &lt;TD&gt;ELECTRONICS_MONTH_02&lt;/TD&gt; 
   &lt;TD&gt;SUPERMARKET_MONTH_01&lt;/TD&gt; 
   &lt;TD&gt;SUPERMARKET_MONTH_02&lt;/TD&gt; 
   &lt;TD&gt;RESTAURANT_MONTH_01&lt;/TD&gt; 
   &lt;TD&gt;RESTAURANT_MONTH_02&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130011&lt;/TD&gt; 
   &lt;TD&gt;4313000&lt;/TD&gt; 
   &lt;TD&gt;2514000&lt;/TD&gt; 
   &lt;TD&gt;230640&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
   &lt;TD&gt;84000&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;130012&lt;/TD&gt; 
   &lt;TD&gt;76000&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
   &lt;TD&gt;321000&lt;/TD&gt; 
   &lt;TD&gt;211000&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
   &lt;TD&gt;16029200&lt;/TD&gt; 
  &lt;/TR&gt; 
 &lt;/TBODY&gt; 
&lt;/TABLE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please let me know if anyone has resolved this on.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&amp;nbsp;Jackson&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 06:14:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transpose-and-mapping-rows-to-columns/m-p/2285046#M58668</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-14T06:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and mapping rows to columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transpose-and-mapping-rows-to-columns/m-p/2285047#M58669</link>
      <description>&lt;P&gt;There are two assumptions that could be made about this. The first is the you know the number of months and categories per month you will receive before you receive the data, and can manually configure columns for them. In this case, it is simply a case of adding a tSortRow (sorting by ID) and then a tMap, using the tMap variables to store your values between rows. Then (and this is the last bit) using a tAggregateRow to group by ID and setting all of the functions for the rows to "Last". Because the tMap variables hold their values between rows, the last row per ID will be fully populated with data.&amp;nbsp;You might need a bit of logic to clear the data down at the end of each group, but that is easy. You can see a loosely related example here (&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCjPhCAK#M595" target="_blank"&gt;https://community.talend.com/t5/How-Tos-and-Best-Practices/Compare-row-value-against-a-value-from-the-previous-row/m-p/133710#M595&lt;/A&gt;).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If you need it in the way of my second assumption (that you do not know before the data arrives how many months and how many categories there will be), then this makes it a little more complicated. Essentially you will need to first parse the data set to identify how many months and how many categories you have. You will need a distinct list of these permutations calculated (maybe added to a tHash component). Then, multiply each row in this distinct list by the number of IDs you are working with. If you have 10 IDs and 10 month/category permutations, you will have 100 rows in you tHash.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Next you will need to use a tMap driven by the list you have just created (sorted by ID and month/category combinations), with your original data as a lookup. Join your original data to your newly created list using the ID columns and your new month/category combined column with those columns concatenated from your lookup. Then use a tMap variable to simply concatenate each value that comes back with a separator, ensuring that when the ID changes, you clear the value of the variable. Pass this data to a single output column ensuring that an ID column is also passed out. Then, after the tMap, add a tAggregateRow and group by ID. Set the function on your other column to be "last". This should result in two output columns; an ID column and a column with all of your concatenated month/category data in the same order for every row. If you output this to a flat file, and open it in Excel it will appear as you want it.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Sep 2018 19:24:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transpose-and-mapping-rows-to-columns/m-p/2285047#M58669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-16T19:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and mapping rows to columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transpose-and-mapping-rows-to-columns/m-p/2285048#M58670</link>
      <description>&lt;P&gt;Did this resolve your issue?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 09:20:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transpose-and-mapping-rows-to-columns/m-p/2285048#M58670</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-19T09:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose and mapping rows to columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transpose-and-mapping-rows-to-columns/m-p/2285049#M58671</link>
      <description>&lt;P&gt;Can you please help me out for how to do pivot for attached example&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LvwW"&gt;Pivot example.xlsx&lt;/A&gt;</description>
      <pubDate>Thu, 13 Jun 2019 14:32:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transpose-and-mapping-rows-to-columns/m-p/2285049#M58671</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-13T14:32:40Z</dc:date>
    </item>
  </channel>
</rss>

