Calculated Fields

by camel

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

Version:

1.2.9.4

Updated:

Apr 11, 2011

Total Distance for last 7 days

Total Distance for last 7 days

Postby MorrisRun » Fri Aug 09, 2013 1:29 pm

I would like to have a rolling 7 day total of my mileage.
I thought Calculated Fields might allow me to get that

From Examples I selected Sum of last 7 days
The expression I got was {DISTANCE(SUM,7)}
I selected a day and calculated the field.
I got 68,206.3 in the field.
I can't run that far in a week.
I was expecting 42.76

Please Advise
MorrisRun
 
Posts: 16
Joined: Thu Jan 12, 2012 3:50 pm

Re: Total Distance for last 7 days

Postby dirk66 » Fri Aug 09, 2013 3:18 pm

Those 68,206.3 are meters i' m not at a computer with ST right now, but i thought that there is an example for what you want in the plugin.

Regards
Dirk
dirk66
Donated!
Donated!
 
Posts: 534
Joined: Thu Feb 26, 2009 6:40 am
Location: Oss, Netherlands

Re: Total Distance for last 7 days

Postby MorrisRun » Fri Aug 09, 2013 3:39 pm

dirk66 wrote:Those 68,206.3 are meters i' m not at a computer with ST right now, but i thought that there is an example for what you want in the plugin.

Regards
Dirk


Thanks for pointing that out. I changed the expression to {DISTANCE(SUM,7)}*0.00062137119224
and got what I was expecting.

I was expecting miles since the units for the Distance field is set for miles not meters.
Is this a bug or a misunderstanding by me?
MorrisRun
 
Posts: 16
Joined: Thu Jan 12, 2012 3:50 pm

Re: Total Distance for last 7 days

Postby texmurphy » Fri Aug 09, 2013 3:54 pm

MorrisRun wrote:...I was expecting miles since the units for the Distance field is set for miles not meters. Is this a bug or a misunderstanding by me?

Underlying data in ST is stored in metric. Your ST display choice results in the conversion.
Maybe some day in the USA we will do things right and not loose Mars probes, etc. due to archaic ways of measuring.
texmurphy
Donated!
Donated!
 
Posts: 2125
Joined: Wed Jul 05, 2006 7:38 pm
Location: Maryland, USA

Re: Total Distance for last 7 days

Postby dirk66 » Fri Aug 09, 2013 4:16 pm

Well ... short answer you're misunderstanding. :P

Long answer:
You can choose different units for categories so it would be logical to store data in the logbook in the same unit regardless what an end-user want. And do some calculation at presentationtime. Using the same unit has it's pro's in efficiency at saving space. If you change a unit of a category a recalculation of all those activities have to be done if the storage would be unit depended. Besides this, if the results of your formula would be depended on your choice for each category there would be a chance that miles, yards, meters and kilometers are summarized, which, of course, isn't what you want.

Probably therefore is chosen to calculate and store in meters. It's just an apointment. It also could have been stored in miles or whatever other unit.

Regards
Dirk
dirk66
Donated!
Donated!
 
Posts: 534
Joined: Thu Feb 26, 2009 6:40 am
Location: Oss, Netherlands

Re: Total Distance for last 7 days

Postby MorrisRun » Fri Aug 09, 2013 9:00 pm

I now understand. I can see where adding two fields together could cause a lot of problems if one was miles and the other meters.

This was my first attempt to use Calculated Fields and I now have what I was seeking.
I wish there was more info about how to use this plugin. The tutorial was very limited. Are more instructions available?

It is nice to have drop downs to select from, but I have not found a list of operands.
From the examples, I saw that I could use contains, *. /, sum, avg and a few more, but is there a list somewhere?

Thanks for helping me get a rolling 7 day total and also for the explanations.
Morris
MorrisRun
 
Posts: 16
Joined: Thu Jan 12, 2012 3:50 pm

Re: Total Distance for last 7 days

Postby GaryS » Sat Aug 10, 2013 10:42 pm

MorrisRun wrote:I would like to have a rolling 7 day total of my mileage.
I thought Calculated Fields might allow me to get that

From Examples I selected Sum of last 7 days
The expression I got was {DISTANCE(SUM,7)}
I selected a day and calculated the field.
I got 68,206.3 in the field.
I can't run that far in a week.
I was expecting 42.76

Please Advise


Here is the formula I use (in miles):

{Distance(Sum, 7)}/1000*.6213881
GaryS
Donated!
Donated!
 
Posts: 77
Joined: Thu Jan 21, 2010 6:25 pm

Re: Total Distance for last 7 days

Postby MorrisRun » Sun Aug 11, 2013 2:58 pm

1 mile = 1609.344 meters
1/1609.344 = 0.000621371192237334
I think your formula is slightly off.
MorrisRun
 
Posts: 16
Joined: Thu Jan 12, 2012 3:50 pm

Re: Total Distance for last 7 days

Postby dirk66 » Mon Aug 12, 2013 2:39 pm

I wish there was more info about how to use this plugin. The tutorial was very limited. Are more instructions available?

not on a wiki page or so. But there are some explanations in the different posts in the plugin forum. Besides that, it is written in C# with Linq.

Regards,
Dirk
dirk66
Donated!
Donated!
 
Posts: 534
Joined: Thu Feb 26, 2009 6:40 am
Location: Oss, Netherlands

Re: Total Distance for last 7 days

Postby MorrisRun » Mon Aug 12, 2013 8:03 pm

Thanks Dirk. I am so old that I used FORTRAN and COBOL and a little DB2. But at least now I know what language it is in and I can probably figure out the syntax if the need arises. I will look for the plugin forum and see it it gives me any ideas.

Thanks to you, I now have an automatic rolling 7 day total.
MorrisRun
 
Posts: 16
Joined: Thu Jan 12, 2012 3:50 pm


Return to Calculated Fields

Who is online

Users browsing this forum: No registered users and 0 guests