<?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: [resolved] Weighted Average in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367943#M131267</link>
    <description>hey,&lt;BR /&gt;I have the following scenario:&lt;BR /&gt;DealId  Quantity   Price&lt;BR /&gt;1               10        5&lt;BR /&gt;1               20        4&lt;BR /&gt;2               7          10&lt;BR /&gt;1               10         6 &lt;BR /&gt;3               12        5&lt;BR /&gt;3               15        4 &lt;BR /&gt;Now i want to find the weighted average based on dealId so the output should be like&lt;BR /&gt;DealId   Weighted average&lt;BR /&gt;1            (10*5 + 20*4 + 10*6)/10+20+10 = 4.75&lt;BR /&gt;2             (7*10)/10 = 7&lt;BR /&gt;3             (12*5 + 15*4)/27 = 4.44&lt;BR /&gt;Thanks!</description>
    <pubDate>Wed, 04 Jun 2014 14:28:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-06-04T14:28:32Z</dc:date>
    <item>
      <title>[resolved] Weighted Average</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367938#M131262</link>
      <description>Hey,
&lt;BR /&gt;Do we have any component or any way to calculate weighted Average in Talend?
&lt;BR /&gt;I am using tAggregate to compute sum, average and count. But i didn't find any function to compute Weighted Average.
&lt;BR /&gt;I know we can do it in tMap by writing the expression but is their any easier way?
&lt;BR /&gt;Thanks!</description>
      <pubDate>Wed, 04 Jun 2014 13:00:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367938#M131262</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-04T13:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Weighted Average</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367939#M131263</link>
      <description>Have you checked this? 
&lt;BR /&gt; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCjiTCAS" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-How-to-compute-weighted-average-in-Talend/td-p/69834&lt;/A&gt; 
&lt;BR /&gt;Vaibhav</description>
      <pubDate>Wed, 04 Jun 2014 13:04:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367939#M131263</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-04T13:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Weighted Average</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367940#M131264</link>
      <description>Yeah i did. But unfortunately i am not using MySql. I am using MongoDB database.
&lt;BR /&gt;Also i wanted it to be dynamic.</description>
      <pubDate>Wed, 04 Jun 2014 13:06:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367940#M131264</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-04T13:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Weighted Average</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367941#M131265</link>
      <description>Any suggestion how to proceed?</description>
      <pubDate>Wed, 04 Jun 2014 14:04:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367941#M131265</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-04T14:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Weighted Average</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367942#M131266</link>
      <description>Hi, 
&lt;BR /&gt;I would definitely use a combination of the tAggregateRow and the tMap with the custom function to make your scenario happen. 
&lt;BR /&gt;If you could add more about your scenario such a Data Set as Input, and the expected Output; I'm sure people will provide more insights and solutions to your use case. 
&lt;BR /&gt;Best regards;</description>
      <pubDate>Wed, 04 Jun 2014 14:09:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367942#M131266</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-04T14:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Weighted Average</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367943#M131267</link>
      <description>hey,&lt;BR /&gt;I have the following scenario:&lt;BR /&gt;DealId  Quantity   Price&lt;BR /&gt;1               10        5&lt;BR /&gt;1               20        4&lt;BR /&gt;2               7          10&lt;BR /&gt;1               10         6 &lt;BR /&gt;3               12        5&lt;BR /&gt;3               15        4 &lt;BR /&gt;Now i want to find the weighted average based on dealId so the output should be like&lt;BR /&gt;DealId   Weighted average&lt;BR /&gt;1            (10*5 + 20*4 + 10*6)/10+20+10 = 4.75&lt;BR /&gt;2             (7*10)/10 = 7&lt;BR /&gt;3             (12*5 + 15*4)/27 = 4.44&lt;BR /&gt;Thanks!</description>
      <pubDate>Wed, 04 Jun 2014 14:28:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367943#M131267</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-04T14:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Weighted Average</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367944#M131268</link>
      <description>Also i want to Rank them or provide sequence number based on quantity (in ascending order so lowest quantity no:1 and so on) 
&lt;BR /&gt;Basically trying to group them based on DealId and then Rank them among that subgroup based on Quantity. Also same quantity have same Rank. 
&lt;BR /&gt;So the scenario would be like this: 
&lt;BR /&gt;Input: 
&lt;BR /&gt;DealId Quantity Price 
&lt;BR /&gt;1 10 5 
&lt;BR /&gt;1 20 4 
&lt;BR /&gt;2 7 10 
&lt;BR /&gt;1 10 6 
&lt;BR /&gt;3 12 5 
&lt;BR /&gt;3 15 4 
&lt;BR /&gt;3 16 5 
&lt;BR /&gt;Output: 
&lt;BR /&gt;DealId Quantity Price Rank 
&lt;BR /&gt;1 10 5 1 
&lt;BR /&gt;1 20 4 2 
&lt;BR /&gt;2 7 10 1 
&lt;BR /&gt;1 10 6 1 
&lt;BR /&gt;3 12 5 1 
&lt;BR /&gt;3 15 4 2 
&lt;BR /&gt;3 16 5 3 
&lt;BR /&gt;Thanks for the support in advance!</description>
      <pubDate>Wed, 04 Jun 2014 14:41:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367944#M131268</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-04T14:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Weighted Average</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367945#M131269</link>
      <description>Hi, 
&lt;BR /&gt;I'm going to answer to your first use case scenario. 
&lt;BR /&gt;Please see the Screenshot JOB. 
&lt;BR /&gt;As you can see, I'm using tMap, tAggregate and tSort jsut to make the data sorted like you have in your OUtput sample. I haven't made any specific functions rather than using classical operation. 
&lt;BR /&gt;Let me describe the flow : 
&lt;BR /&gt;Step #1 : you have to start with the Metadata of your File; I use Integer for the DealID, and Double for the 2 other columns. (see MetadataForInput_File) 
&lt;BR /&gt;Step #2 : I'm using a tMap to add a new column named Cost which is the operation Quantity*Price (see tMap1) 
&lt;BR /&gt;Step #3 : I'm using the tAggregate component to group by DealId and sum each column Quanity and Cost (see tAggregate1) 
&lt;BR /&gt;Step #4 : then I'm using another tMap to Divide the sumCost by sumQuantity to get the Weighted average. (see tMap2) 
&lt;BR /&gt;Step #5 : I finally sort by Deal Id through the tSortRow. (see tSort) 
&lt;BR /&gt;Best regards; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEKG.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158104iA25A17CE6D663EF9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEKG.png" alt="0683p000009MEKG.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEK7.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142406i93489DA1D7465979/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEK7.png" alt="0683p000009MEK7.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEKL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141579iC1E29536EA8DA5E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEKL.png" alt="0683p000009MEKL.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDxi.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144375i17879BBF72B5D0C3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDxi.png" alt="0683p000009MDxi.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEKQ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144118i33686F699B922B0A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEKQ.png" alt="0683p000009MEKQ.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEKV.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/131338i3FD9533A66D4D830/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEKV.png" alt="0683p000009MEKV.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 04 Jun 2014 19:57:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367945#M131269</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-04T19:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Weighted Average</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367946#M131270</link>
      <description>Thanks a lot for the help. It works fine in my use case.&lt;BR /&gt;Really Appreciate the help.&lt;BR /&gt;Looking forward for the 2nd answer.</description>
      <pubDate>Thu, 05 Jun 2014 06:38:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367946#M131270</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-05T06:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Weighted Average</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367947#M131271</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Hi,&lt;BR /&gt;I'm going to answer to your first use case scenario.&lt;BR /&gt;Please see the Screenshot JOB.&lt;BR /&gt;As you can see, I'm using tMap, tAggregate and tSort jsut to make the data sorted like you have in your OUtput sample. I haven't made any specific functions rather than using classical operation.&lt;BR /&gt;Best regards;&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Hey, I appreciate the help provided.
&lt;BR /&gt;I have a query. 
&lt;BR /&gt;This approach is a row level processing which we do in general programming.
&lt;BR /&gt;As Talend is an ETL tool, I was looking for some column level processing (or Bulk processing). 
&lt;BR /&gt;Because when I will have huge data this processing will take some time.
&lt;BR /&gt;Please let me know is thier any other or efficient way to achieve this.
&lt;BR /&gt;Thanks a lot for all the support!</description>
      <pubDate>Thu, 05 Jun 2014 09:30:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367947#M131271</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-05T09:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Weighted Average</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367948#M131272</link>
      <description>We could definitely turn this Job as ELT/SQL Pushdown mode to scale if your data become huge.
&lt;BR /&gt;Beside the Aggregate and Sort operations; the rest of the other operations will work just fine in the Design I did and you won't benefit any better performance if you want to take advantage of your Column level processing approach.
&lt;BR /&gt;You alternative are : 
&lt;BR /&gt;#1 you bulk load your Input file in a RDBMS database and you perform your operation using our ELTMap capabilities.
&lt;BR /&gt;#2 you adopt a best of breed approach; you load in Databse; the result of the first tMap1; then you perform the Aggregate and Sort in database using the ELT approach; and then you read/extract the Table perform the tMap2 operation in order to produce back your output file expected.
&lt;BR /&gt;Best regards;</description>
      <pubDate>Thu, 05 Jun 2014 13:49:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Weighted-Average/m-p/2367948#M131272</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-05T13:49:26Z</dc:date>
    </item>
  </channel>
</rss>

