Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Amphan
Contributor III
Contributor III

How do I find continuous interval

Hi, I have a table with 3,65 million rows where I have 365 dates and each date has 10 000 keys (PersonID) and some attributes. I'd like to convert this to a table with PersonID, attributes and a daterange of StartDate and EndDate like in the sample tables below. I do not now how to achive this, does anyone have an idea that could help me?

Original table:

New table:

TIA

Ola

1 Solution

Accepted Solutions
sunny_talwar

Should be easy like this

LOAD PersonID,

     FirstName,

     LastName,

     Min(Date) as StartDate,

     Max(Date) as EndDate

FROM ...

Group By PersonID, FirstName, LastName;

View solution in original post

2 Replies
sunny_talwar

Should be easy like this

LOAD PersonID,

     FirstName,

     LastName,

     Min(Date) as StartDate,

     Max(Date) as EndDate

FROM ...

Group By PersonID, FirstName, LastName;

Amphan
Contributor III
Contributor III
Author

Worked perfectly, thanks! I got my new tables size down to only 4,6% of the original table!

//Ola