Problem with Pivot Stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ak77
Charter Member
Charter Member
Posts: 70
Joined: Thu Jun 23, 2005 5:47 pm
Location: Oklahoma

Problem with Pivot Stage

Post by ak77 »

Hello Everybody,

I used a Pivot stage to do horizontal pivotting
I connected a Transformer stage to filter those pivotted record with null values
Not(IsNull(filed name))

I am getting all the rows
I tried using trim to remove any space
Not(IsNull(Trim(filed name)))

and even then it was doing the same

So I loaded the output of the pivot stage to a Sequential file and then passed this through the Transformer for filtering

I got the right output

Can somebody explain me this?

Thank you

Regards,
Kishan
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

If <Not(IsNull(Trim(filed name)))> is not working, then it is probably because you have empty strings rather than NULLs.

Try Trim(filed name) <> "" and see if that works.
Ross Leishman
kris
Participant
Posts: 160
Joined: Tue Dec 09, 2003 2:45 pm
Location: virginia, usa

Re: Problem with Pivot Stage

Post by kris »

ak77 wrote: I used a Pivot stage to do horizontal pivotting
I connected a Transformer stage to filter those pivotted record with null values
Not(IsNull(filed name))

I am getting all the rows
I tried using trim to remove any space
Not(IsNull(Trim(filed name)))

and even then it was doing the same
Hi Kishan,

You can not filter on the data that is coming out of Pivot in the transformer which is next to pivot.

You can have another transformer next to the above transformer and filter the data in it.

Pivot will output many records no matter what you do, it is not going to give you one by one record rather it gives all at once. So in the transformer next to Pivot you will have all those many records in one shot.

If you have another transformer in the way out, you will have the provision to process those many records coming out pivot thru the transformer one by one, that way you can filter.

You don't have to land the data to sequential file, instead use another transformer and filter the data.

This will do it.

Kris~
~Kris
Post Reply