Page 1 of 1

Last Record

Posted: Mon Sep 11, 2006 12:25 am
by kris_r
Hi,
I want to know how to extract the last record of a particular column.
I have 2 columns
A B
1 2
2 3
3 NULL

B should have one value greater than A. The last Record of A should be null. How to extract the last record of A..

Posted: Mon Sep 11, 2006 12:40 am
by sb_akarmarkar
Hi,

Use aggregator stage choose "Last" aggregation function in derivation....

Thanks,
Anupam

Posted: Mon Sep 11, 2006 12:45 am
by kris_r
But, how to assign NULL to that particular last record?

Posted: Mon Sep 11, 2006 2:19 am
by kris_r
Any idea Guys?

Posted: Mon Sep 11, 2006 2:25 am
by thurmy34
Hi

With a transformer you can assign what you want to the last record.

Posted: Mon Sep 11, 2006 2:44 am
by sb_akarmarkar
Hi,

In transformer use @NULL...


Thanks,
Anupam

Posted: Mon Sep 11, 2006 2:49 am
by kris_r
In the same column B, I should increment all the values by One, but the last value should be NULL.

Posted: Mon Sep 11, 2006 3:04 am
by sb_akarmarkar
Can you provide source data example how it is ?

Thanks,
Anupam

Posted: Mon Sep 11, 2006 3:09 am
by kris_r
I have 2 columns A & b.
The column A contains 1,2,3. The Output should be like below:

A B
1 2
2 3
3 NULL

Posted: Mon Sep 11, 2006 3:17 am
by loveojha2
What about an update after the load, like

Code: Select all

update tgt set b=null where a=(select max(a) from tgt)

Posted: Mon Sep 11, 2006 3:29 am
by kris_r
Hey loveojha2 :) ! Thanks, it worked.

Posted: Mon Sep 11, 2006 3:51 pm
by ray.wurlod
kris_r wrote:Any idea Guys?
Etiquette Note
This is an all volunteer site. Folks post as and when they can. If you want urgent answers sign up with your support provider for premium service and learn the true cost of "urgent". Don't push. Not everyone is in your time zone, and we do need our sleep.