Page 1 of 1

Count of column which is varchar datatype

Posted: Tue Sep 29, 2009 4:26 am
by cmunikoti
I have an issue .i got input as

col1 | col2
abc | y
abc | NULL
abc1 | y
abc1 | y
abc1 | NULL
abc3 | y

i want ouput as

col1 | count_col2
abc | 1
abc1 | 2
abc3 | 1

I used aggregator stage and used "count of non missing value" on the column "col2".i am getting output as

col1 | count_col2
abc | 0
abc1 | 0
abc3 | 0

in server edition i am getting the right output but can't i do the same in PX?
help me out :(

regards,
cmunikoti

Posted: Tue Sep 29, 2009 6:12 am
by ArndW
What output are you getting in PX and have you tried it with a 1-node configuration file?

Posted: Tue Sep 29, 2009 6:51 am
by cmunikoti
ArndW wrote:What output are you getting in PX and have you tried it with a 1-node configuration file? ...

Yes, actually i tried with execution mode as sequential also ,but giving same out put

col1 | count_col2
abc | 0
abc1 | 0
abc3 | 0

is it possible to take a count of varchar column?

regards,
cmunikoti

Re: Count of column which is varchar datatype

Posted: Tue Sep 29, 2009 6:58 am
by rajngt
use a filter stage to filter-out based on col2 non-null value. then try aggregating