Some statistics rely on "linked" field values

Discussions about the smartphone versions
Post Reply
aplord
Posts: 23
Joined: Mon Apr 21, 2008 11:00

Some statistics rely on "linked" field values

Post by aplord »

Hi Sven, firstly thanks for a brilliant app, this is truly wonderful.

One thing I have noticed: for the statistics re Dive Sites, Cities, Countries, Buddies, they will only count in the iPhone app if the entries in DL5 are linked (with the little link icon). If they are not linked, even if with the precise same values, they are not counted. I'm not that bothered, but it was confusing for a while...

Thanks again for a brilliant app!

Cheers

Al
divinglog
Site Admin
Posts: 5780
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Some statistics rely on "linked" field values

Post by divinglog »

Hi Al

Yes, this is due to performance on the iPhone. I have already a function to automatically convert unlinked items to linked items so they show up on the iPhone.

Kind regards,
Sven
aplord
Posts: 23
Joined: Mon Apr 21, 2008 11:00

Re: Some statistics rely on "linked" field values

Post by aplord »

divinglog wrote:I have already a function to...
Great news Sven! Is this avail now or for future release? I can't see it anywhere.

Cheers

Al
divinglog
Site Admin
Posts: 5780
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Some statistics rely on "linked" field values

Post by divinglog »

I'm not yet sure if it's a good idea to expose this function to everyone, because it's a bit hard to explain and it is not sure that it does everything 100% perfect. The function calls these 6 SQL statements on the database:

Code: Select all

INSERT INTO Country (Country) SELECT DISTINCT Country FROM Logbook
INSERT INTO City (City) SELECT DISTINCT City FROM Logbook
INSERT INTO Place (Place) SELECT DISTINCT Place FROM Logbook
UPDATE Logbook INNER JOIN Country ON Logbook.Country=Country.Country SET Logbook.CountryID = Country.ID
UPDATE Logbook INNER JOIN City ON Logbook.City=City.City SET Logbook.CityID = City.ID
UPDATE Logbook INNER JOIN Place ON Logbook.Place=Place.Place SET Logbook.PlaceID = Place.ID
You can execute these statements if you have MS Access. But this won't work well if you have for example the same dive site name used in different dives but these sites are in different countries. This could happen easily for generic dive site names. So you could end up with wrong links and I'm not sure if I want to make this function public. Maybe I can create a better way to create these links so it's more failsafe.

Cheers,
Sven
Post Reply