-Re: Sum and count of fields
Prashant Kommireddi 2012-04-15, 05:52
You mean count of distinct elements at f5?
Sent from my iPhone
On Apr 14, 2012, at 10:44 PM, Shin Chan <[EMAIL PROTECTED]> wrote:
> I have data something like
> Rows with 5 fields
> I have to produce final dump output as
> f1,f2,f3, SUM( all fields at f4 position) , COUNT ( number of fields at f5 position ) , f4 , f5
> I am trying to do using group , foreach , flatten but its getting confusing. Since flatten produce cross product i am getting lots of rows.
> My final output should have same number of rows as input but with SUM , COUNT columns added.
> Thanks in advance for your help