Calculated Fields

by camel

Downloads: 23,661 (9) • Reviews: 4

Version:

1.2.9.4

Updated:

Apr 11, 2011

Time and distance for certain splits

Time and distance for certain splits

Postby guillaum » Sun May 06, 2012 9:32 am

I am trying to get a data on time and distance of certain splits - those for which I will put a certain comment like "Select" in the split notes. This would allow me to manipulate the data of certain selected splits only. Do you have any code handy ?
Thanks
Guillaume
guillaum
 
Posts: 5
Joined: Sat Nov 05, 2011 10:35 am

Re: Time and distance for certain splits

Postby camel » Sun May 06, 2012 1:23 pm

Get a look at DataTrack feature in Formulas pool thread. It's not very much documented. Because it's too hard to use for standard user. (it's based on LINQ)

viewtopic.php?f=67&t=9262&start=125

And here is formula for example to get average hr of split with "Select" note:
{DATATRACK}.Where(o => o.LapNote == "Select").Average(o => o.HR)

And much more could be done with this feature. Note that you can set DataTrack feature resolution to make it more precise and slower or opaque.

Nice day
Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Re: Time and distance for certain splits

Postby guillaum » Mon May 07, 2012 8:38 am

Thanks, this is very useful.

I understand from the Formula Pool / Datatrack thread that time in seconds will be given by

{DATATRACK}.Where(o => o.LapNote == "Select").Count()

Waht is the formula to have the distance achieved during these laps ? I guess the datatrack distance category is for the total distance reached since the start of the run ?

Thanks very much !

Guillaume
guillaum
 
Posts: 5
Joined: Sat Nov 05, 2011 10:35 am

Re: Time and distance for certain splits

Postby camel » Mon May 07, 2012 10:01 am

This is how you get start distance of your split:
{DATATRACK}.Where(o => o.LapNote == "Select").Select(o => o.Distance).First()

And End distance of your split:
{DATATRACK}.Where(o => o.LapNote == "Select").Select(o => o.Distance).Last()

I simply get first point from split and get it's distance and than get last point of split and it's distance.
If you substract end from start, you will get distance of that split:
{DATATRACK}.Where(o => o.LapNote == "Select").Select(o => o.Distance).Last() - {DATATRACK}.Where(o => o.LapNote == "Select").Select(o => o.Distance).First()

Nice day
Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia


Return to Calculated Fields

Who is online

Users browsing this forum: MSN [Bot] and 1 guest