Analytical Output - grouping

Analytics
Enthusiast

Analytical Output - grouping

Hi,

I have provided below the sample data (section 1), for which we need to get the output given underneath that (section 2). You help would be greatly appreciated.

Section-1

F1 F2 F3
A001 1000 1-Jan-2015
A001 1000 2-Jan-2015
A001 1000 3-Jan-2015
A001 1000 4-Jan-2015
A001 1000 5-Jan-2015
A001 2000 6-Jan-2015
A001 2000 7-Jan-2015
A001 2000 8-Jan-2015
A001 1000 9-Jan-2015
A001 1000 10-Jan-2015
A001 2000 11-Jan-2015
A001 2000 12-Jan-2015
A001 3000 13-Jan-2015
A001 3000 14-Jan-2015
A001 3000 15-Jan-2015

Section2-

F1 F2 F3_start F3_End
A001 1000 1-Jan-2015 5-Jan-2015
A001 2000 6-Jan-2015 8-Jan-2015
A001 1000 9-Jan-2015 10-Jan-2015
A001 2000 11-Jan-2015 12-Jan-2015
A001 3000 13-Jan-2015 15-Jan-2015

Thank you.

1 REPLY
Senior Apprentice

Re: Analytical Output - grouping

What's your Teradata release?

TD14.10 supports a new SELECT option:

SELECT f1,f2,BEGIN(pd),LAST(pd)
FROM
(
SELECT NORMALIZE
f1, f2, PERIOD(f3, f3+1) AS pd
FROM dropme
) AS dt