How to find First recharge?

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
pkll
Participant
Posts: 73
Joined: Thu Oct 25, 2012 9:45 pm

How to find First recharge?

Post by pkll »

I have two tables

Recharge_Details
SUBSCRIBER_ID,RECHARGE_DATE_TIME,SERIAL_NUMBER.

First_Rechrge
SUBSCRIBER_ID,RECHARGE_DATE_TIME,SERIAL_NUMBER.

Compare the Recharge_Details SUBSCRIBER_ID with
first_recharge table SUBSCRIBER_ID (at initial level First_Recharge
table is blank) , if SUBSCRIBER_ID
already present in First recharge table ignore else insert SUBSCRIBER_ID into First_recharge table

I need to capture first recharge of SUBSCRIBER_ID...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You have a couple of choices, effectively the same logically.

Perform a lookup against first recharge table with Lookup Failed rule set to Continue, then test in a downstream Transformer stage whether the columns returned from the reference input are NULL.

Or perform a left outer join, with recharge details as the left input, then process similarly in a downstream Transformer stage.

Getting a premium membership would be good, too.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pkll
Participant
Posts: 73
Joined: Thu Oct 25, 2012 9:45 pm

Post by pkll »

Hi Ray,

I have written query in oracle connector

SELECT SUBSCRIBER_ID,RECHARGE_DATE_TIME,SERIAL_NUMBER FROM Recharge_Details ORDER BY RECHARGE_DATE_TIME;

After that i have taken remove duplicate stage .In Removeduplicate stage key = SUBSCRIBER_ID
Duplicate to Retain = First.

Can you suggest me above process is correct or not?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes and no. According to the specification in your original post you also have to undertake some kind of checking/processing against the FIRST_RECHARGE table. Your more recent post on this thread seems to omit this requirement altogether.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

pkll wrote:Can you suggest me above process is correct or not?
Can you suggest us if above process seemed to work or not? :?
Last edited by chulett on Sat Apr 20, 2013 6:44 am, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

<found at the bottom of the post>
ray.wurlod wrote:Getting a premium membership would be good, too.
:wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply