#1 2012-04-23 17:01:03

emmis
Member
Registered: 2011-07-06
Posts: 13

lost data?

I have some Problems with tAggregatedRow.

tAggregatedRow itself works fine. I Make som max and sum and everythink is correct.

BUT: My datastream has 10 columns, only 4 of them are aggregated over 1 group-column. Bevor the tAggregated-Step ... tlog shows me data in all 10 columns, after the tAggregated-Step a tlog shows me only in 5 (in the aggregetd and used columns) of 10 columns data. The Rest is emty, but there. Whats wrong?

Offline

#2 2012-04-23 17:05:02

elvis
Member
Registered: 2011-12-22
Posts: 15

Re: lost data?

If you have aggregated the multiple rows together then the component doesn't know how to handle the columns that you HAVN'T specified should be MAX'd or SUM'd.

In this circumstance I generally use first, last, max or min on the other columns.

Does this make sense?

Offline

#3 2012-04-23 17:08:53

emmis
Member
Registered: 2011-07-06
Posts: 13

Re: lost data?

It works, but its not "beautiful" ... is there no other solution?

Offline

#4 2012-04-23 19:07:03

elvis
Member
Registered: 2011-12-22
Posts: 15

Re: lost data?

If you think about it what else is the component to output?
Say you have the following date
Group, ValuetoSum, OtherValue
A,1,1
A,1,2
A,3,3
B,2,4
B,1,5

The first 2 columns are easy
A,5
B,3

But what value should you return for the third, it could I guess return:
A,5,1
B,3,4
i.e. the first value or
A,5,3
B,3,5
the last but either is not strictly speaking right.

If you try the same in SQL i.e.

Select Group, SUM(ValuetoSum) asValuetoSum , OtherValue
from foobar
group by Group

It'll throw an error.

Offline

#5 2012-04-23 22:54:38

phobucket
Member
Company: Knoetry
Registered: 2010-07-27
Posts: 146
Website

Re: lost data?

Elvis is right that whatever fields are not aggregated need to be part of the group by.  If you want the other 5 columns to include data, add them to the group by section of tAggregateRow.   

If you don't want these columns, change your input format (via a tMap) to only include the 5 columns you need.

Offline

Board footer

Powered by FluxBB