Count of column which is varchar datatype

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
cmunikoti
Participant
Posts: 18
Joined: Mon Jun 29, 2009 6:40 am

Count of column which is varchar datatype

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

What output are you getting in PX and have you tried it with a 1-node configuration file?
cmunikoti
Participant
Posts: 18
Joined: Mon Jun 29, 2009 6:40 am

Post 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
rajngt
Participant
Posts: 32
Joined: Wed Jan 04, 2006 6:22 am

Re: Count of column which is varchar datatype

Post by rajngt »

use a filter stage to filter-out based on col2 non-null value. then try aggregating
Post Reply