Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Should be easy like this
LOAD PersonID,
FirstName,
LastName,
Min(Date) as StartDate,
Max(Date) as EndDate
FROM ...
Group By PersonID, FirstName, LastName;
Should be easy like this
LOAD PersonID,
FirstName,
LastName,
Min(Date) as StartDate,
Max(Date) as EndDate
FROM ...
Group By PersonID, FirstName, LastName;
Worked perfectly, thanks! I got my new tables size down to only 4,6% of the original table!
//Ola