1

Re: Reporting on most recent records only

Is there a way of doing this?  Perhaps I've missed something but I can't find a way of restricting a site report/species list to the most recent records only.  In other words, if I want a list with observation attributes plus sample location and date, with just the most recent record for each species, I have to export it all to Excel and laboriously pick out the most recent ones for each species, using Excel filters.  Even just producing a basic list of species which occur on a  site is hard enough, but getting the most recent one seems impossible.  Is there something obvious that I'm missing?

2

Re: Reporting on most recent records only

If you can define exactly which fields you require I  will do you an XML report which will pick up just the latest record for a site.  If you have vague dates in your system then please can you also advise how you want the latest record identified (ie based on vague date start or vague date end). Also do ou have a Location hierarchy in place and if you do, then do you a want to include sub site data ?.

Mike Weideli

3

Re: Reporting on most recent records only

Ooh, thanks Mike!  That would be very helpful.  Vague start dates rather than end dates, and both sites and subsites, would be preferable if possible.   Fields would be:
Taxon group, Taxon Latin name, Taxon common name, Event location, Event location name, Sample location name, Sample spatial ref, Sample Recorder, Sample Determiner, Observation Comment, Survey name, [most recent available]Vague date start, associated Vague date end if applicable.  The latter could be omitted.

Data input over the (many) years of using Recorder here has resulted in a rather patchy choice of input fields, especially for locations, but the ones above usually give us everything available for the most common queries that need a most-recent date.  It would be marvellous to have a quick report for this.  I hope this isn't too onerous to code...

4

Re: Reporting on most recent records only

Linda

I have had a go at this and the zipped file is at

http://forums.nbn.org.uk/uploads.php?file=LC_LatestRecordForSite.zip

Unzip the file into the User File/Reports folder of Recorder 6 and you should see the report in Report/LCReports, or you can run it as a quick report by right clicking on the Locations and selecting the report from there.

I have added a second report which gives the same information but for all records for the location. This can be used to check the report and may be of general use. 

Both run, but I haven't done much testing on what happens in various situations.

Let me know how you get on.

Mike Weideli

5

Re: Reporting on most recent records only

Mike,
:)This is fantastic, thanks!  It's kind of you do this so quickly as well.
Btw, Can we also use this with polygons (i.e. a search for a planning app area given to us originally as a shapefile, etc.)? (doesn't matter if not, I just wondered).

Linda

6

Re: Reporting on most recent records only

I have been working on just such a report for polygons, although perhaps rather simpler in terms of output fields, Linda, when we have tested it a little more comprehensively I would be happy to pass it on.

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre

7

Re: Reporting on most recent records only

Thanks Rob - that would be great!

8

Re: Reporting on most recent records only

Looking at your specification Linda I forsee a little difficulty. I have been working on this query in order to generate site species lists (rather than a list of records) which summarise both records associated explicitly with the site and those which have spatial refs falling (partially or wholly) within the site boundary but which are not specifically recorded as at the site. In order to make this work and correctly return only one date per taxon (in my case the vague end date rather than start, but no matter) it has been necessary to include (apart from the date) only fields which relate to the taxon (latin name, common name, status etc), rather than those which relate to the occurrence (e.g. location information, determiner etc).
This is because the query must group the occurences by all the non-date fields in order to function correctly. The problem then is that if you include all the other fields you will end up with a list of records, rather than a list of species.
It would be possible to add all the other stuff back in after the main part of the query has run, but the means by which this was done would need careful consideration.
For example if the polygon contains several records for a given species, these will most likely all have different recorders and determiners, perhaps different NGRs, locations, comments. Would you want to only return determiner etc. for the most recent record of a given taxon?

I think I should go and look at what Mike has already given you...

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre

9

Re: Reporting on most recent records only

It should  be easy enough to convert what I have done to work on polygons rather than on Locations. At the moment. it works out all the Taxon_Occurrences for the specified Location(s) then chooses the latest one of these for each taxon. It would need to be changed to pick up all the Taxon_Occurrences for the specified polygon, then it should work OK.   Once you have the latest occurrence for each species then  you can add in all the other required info.

Working out the earlist Taxon Occurrence for each species is a bit difficult because you coudl potentially have many Occurrence for a species  with the same date and even the same species mutiple times within a sample.

Mike

Mike Weideli

10

Re: Reporting on most recent records only

Thanks both; sorry not to reply sooner, I've been away for a while.
I'll see what I can do with Mike's query, and try to work out a way of using it for polygons.  It should be OK, although I might simplify the fields chosen.

11

Re: Reporting on most recent records only

I have attempted the polygon version of the report. It is at

http://forums.nbn.org.uk/uploads.php?file=LC_LatestRecordFoPolygon.zip

You can draw the polygon on the map or import it.  Might be slow with very large polygons.

Mike Weideli

12

Re: Reporting on most recent records only

Mike,
Thanks for the polygon add-in - Holly hasn't had a chance to test it "in anger" yet (look out everyone!) but as far as I can see it works OK and is going to be useful.  Thanks so much for your input - much appreciated.

Linda