Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a script that shows the following data say named : DataList
DataList
LocationID | DATE |
---|---|
7001 | 6/2/2013 |
7001 | 6/2/2013 |
7001 | 7/2/2013 |
7001 | 8/2/2013 |
2000 | 12/3/2013 |
3000 | 6/2/2013 |
I need another script that removed the duplicated dates for same locationID and add another column which show number of duplicate for each date so have to be like this
LocationID | Date | CountDate |
---|---|---|
7001 | 6/2/2013 | 2 |
7001 | 7/2/2013 | 1 |
7001 | 8/2/2013 | 1 |
2000 | 12/3/2013 | 1 |
3000 | 6/2/2013 | 1 |
Please anyone help this is important
Hi,
you can aggregate into a new table:
Result:
NOCONCATENATE LOAD LocationID, Date, Count(Date) as CountDate
Resident DataList
Group By LocationID, Date;
- Ralf
Hi,
you can aggregate into a new table:
Result:
NOCONCATENATE LOAD LocationID, Date, Count(Date) as CountDate
Resident DataList
Group By LocationID, Date;
- Ralf
Thanks alot man . Your a life saver
Hi,
Please try this:
Task:
NOCONCATENATE LOAD Location, Date, Count(Date) as CountDate
Resident Test
Group By Location, Date;
Where 'Test' is the name where you are calling your table.
Thanks,