Calculated Fields

by camel

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

Version:

1.2.9.4

Updated:

Apr 11, 2011

Calculated Fields plugin: Gathering features requests

Postby camel » Thu Oct 14, 2010 3:06 pm

mazoaguirre wrote:hi

in conditions i see that can use {CATEGORY}.Contains("Correr")

my question is

there is a list of modifiers (like Contains) that can be used


You wanted it...
Note that we have C# compiler in background so nearly everything can be done and that's one reason why I just can't post all methods that can be used within plugin ;)

So all methods of string object can be used...

Here is a list of methods that can be used. To make you crying (see Properties and Methods part of page)
http://msdn.microsoft.com/en-us/library/system.string.aspx
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby camel » Thu Oct 14, 2010 3:22 pm

Here is a list of some usable methods for you:
{CATEGORY}.Contains("text")
{CATEGORY}.StartsWith("text")
{CATEGORY}.ToLower()
{CATEGORY}.ToUpper()
{CATEGORY}.EndsWith("text")
{CATEGORY}.Trim()

These methods are applicaple to any text used in formula.

So this is possible too:
{NOTES}.ToUpper()

or

"mytext".ToUpper()

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

Postby mazoaguirre » Thu Oct 14, 2010 3:31 pm

there is some to use Contains but at same time that notcontains

i ask because i have my categories i many levels so some part of the path is similar
FR 310 and Foot Pod, Edge 500 and Cadence Sensor, GoPro HD 960
mazoaguirre.com
mazoaguirre
Contributor!
Contributor!
 
Posts: 1081
Joined: Fri May 27, 2005 6:29 pm
Location: San Felipe "Torres Mochas" Guanajuato Mexico

Postby camel » Thu Oct 14, 2010 3:41 pm

mazoaguirre wrote:there is some to use Contains but at same time that notcontains

i ask because i have my categories i many levels so some part of the path is similar


You want this?

{CATEGORY}.Contains("positive") && !{CATEGORY}.Contains("negative")

In words Category must contain "positive" AND Category don't contain "negative"

! before {CATEGORY} is negation of expression
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby mazoaguirre » Thu Oct 14, 2010 4:58 pm

OK thanks a lot
FR 310 and Foot Pod, Edge 500 and Cadence Sensor, GoPro HD 960
mazoaguirre.com
mazoaguirre
Contributor!
Contributor!
 
Posts: 1081
Joined: Fri May 27, 2005 6:29 pm
Location: San Felipe "Torres Mochas" Guanajuato Mexico

Postby emcotrina » Wed Oct 20, 2010 7:12 am

Peter,

Today I installed the plugin and I have the first enhancement request.

Can the custom field be one in the athlete view?
An example:
Waist to Hip Ratio (WHR) is a calculated field for me. Every week (when I take all my mesurements) I calculated that one: my waist, my hip, use the calculator ... Today I was happy, I installed the plugin ... and ... :( I had to use the calculator because I could not choose my waist and my hip as they are custom fields in my athlete view.

Can you do something there?

Thanks a million,

Ellie
emcotrina
Donated!
Donated!
 
Posts: 89
Joined: Fri Jun 04, 2010 6:16 am

Postby camel » Wed Oct 20, 2010 7:25 am

You can easily fill this calculation on activity. That's supported.
Because athlete fields and athlete custom fields are supported for use on calculations on activity.

But that's probably not what you want.
Or it's enough?

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

Postby emcotrina » Wed Oct 20, 2010 7:45 am

It was not what I wanted, but it is good enough for getting graphs and alerts, thanks :)
emcotrina
Donated!
Donated!
 
Posts: 89
Joined: Fri Jun 04, 2010 6:16 am

Postby camel » Wed Oct 20, 2010 7:50 am

emcotrina wrote:It was not what I wanted, but it is good enough for getting graphs and alerts, thanks :)


Of course I'm taking notes you are first or second user with this request of filling calculated values into athlete custom field.

If there will be more requests for this feature I'll consider to add it. But to be honest, now it's a little out of philosophy of plugin.

Just for your information, many users wanted to do opaque. They are filling athlete values to activities to have it one heap.

Please read tutorials from plugin's webpage. They will help you to create formula:
http://code.google.com/p/calculatedfields/w/list

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

Postby Ruskie » Thu Oct 21, 2010 11:05 am

Huh... I've understood perhaps 1% of what has been written in this thread (oddly, I got the car/cdr thing from my days of functional programming at the Uni), however...
I thought I could use this nice plugin to calculate a rough value for something my Garmin does not have, that is the Polar Running Index.
As many of you might know, it is a comparative value one can use to measure the intensity of a workout, just like IF in training analysis plugin.
The book "The Runner's Edge" explain parts of how it is calculated: in each moment it estimates the VO2max speed which is calculated like this:

Current speed divided by (current HR - rest HR) divided by reserve HR.

I've put this into a plugin formula for a calculated field which I named meanVO2maxSpeed (you choose an easier name), which is:

{AVGSPEED}/({AVGHR}-{ATHLETERESTHR})/({ATHLETEMAXHR}-{ATHLETERESTHR})

This gives the average VO2max speed for the workout. Unfortunately the book does not tell how Polar converts it to its Running Index, but it says they are more or less linear, so I guess I'll use this in substitution for the Running Index.
If anybody has the missing chain and knows the final step to get to Running Index, let me know. :)
Ruskie
 
Posts: 120
Joined: Sun Mar 08, 2009 11:24 am

Postby camel » Thu Oct 21, 2010 11:18 am

Ruskie wrote:Huh... I've understood perhaps 1% of what has been written in this thread (oddly, I got the car/cdr thing from my days of functional programming at the Uni), however...
I thought I could use this nice plugin to calculate a rough value for something my Garmin does not have, that is the Polar Running Index.
As many of you might know, it is a comparative value one can use to measure the intensity of a workout, just like IF in training analysis plugin.
The book "The Runner's Edge" explain parts of how it is calculated: in each moment it estimates the VO2max speed which is calculated like this:

Current speed divided by (current HR - rest HR) divided by reserve HR.

I've put this into a plugin formula for a calculated field which I named meanVO2maxSpeed (you choose an easier name), which is:

{AVGSPEED}/({AVGHR}-{ATHLETERESTHR})/({ATHLETEMAXHR}-{ATHLETERESTHR})

This gives the average VO2max speed for the workout. Unfortunately the book does not tell how Polar converts it to its Running Index, but it says they are more or less linear, so I guess I'll use this in substitution for the Running Index.
If anybody has the missing chain and knows the final step to get to Running Index, let me know. :)


Yes beginning of this thread was just an request gathering for concept of this plugin. So it's a big chaos of features description and concept :)

Now you can use simpler thread for formulas pool: (many users have there posted nice formulas)
http://www.zonefivesoftware.com/sporttracks/forums/viewtopic.php?t=9262

Or plugin has it's on webpage with tutorials. So this will help you much more.

And I have created this new thread for official release of plugin. So you can post question there:
http://www.zonefivesoftware.com/sporttracks/forums/viewtopic.php?t=9311
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby Ruskie » Thu Oct 21, 2010 11:27 am

Thanks camel. ;)
Ruskie
 
Posts: 120
Joined: Sun Mar 08, 2009 11:24 am

Postby runningC! » Thu Oct 28, 2010 8:24 am

Hi camel,
I really appreciate your plugin!
I'm now playing with Custom Data Fields and formulas and I think that a new feature (or perhaps a new plugin) could be a sort of "customizable activity detail page" where you can put calculated fields along with labels...

Is there something similar out there? What do you think?

C!
runningC!
Donated!
Donated!
 
Posts: 12
Joined: Thu Jan 31, 2008 6:38 am

Postby HENNES » Thu Oct 28, 2010 9:09 am

runningC! wrote:Hi camel,
I really appreciate your plugin!
I'm now playing with Custom Data Fields and formulas and I think that a new feature (or perhaps a new plugin) could be a sort of "customizable activity detail page" where you can put calculated fields along with labels...

Is there something similar out there? What do you think?

C!


Maybe.......

Since few weeks there is FIND THE BEST plugin (very nice)

http://www.zonefivesoftware.com/sporttr ... php?id=204

Ive spoke to Vonni (the author) to "include" the custom fields into it, so numbers can be charted, sorted, etc.. Since a few days Ive got a BETA of that already - very nice. She gone on vacation (probably needed a rest from my mails) and will be back next weekend. The official release should not be to far away.
rgds hennes
- kickbiking with FR 305 and STs 3

runner´s map ... EURE Karte für Laufveranstaltungen - zum MITMACHEN!!!
http://www.runnersmap.info
...mehr als DREI TAUSEND Laufveranstaltungen!
HENNES
Donated!
Donated!
 
Posts: 1185
Joined: Thu Feb 07, 2008 1:55 am
Location: Duesseldorf, Germany

Postby runningC! » Thu Oct 28, 2010 10:50 am

Yes Hennes, that could be a good start for charting (but for number values you can already use standard ST reports).

I was thinking about something more complicated. Suppose you'd like to monitor all those numbers coming from VO2max% Vdot and so on. With the feature I'm thinking about you should be able to add a new "custom activity summary" where you can put those fields. And again, if you want a page about splits and paces to monitor negative splits, you can do another custom activity summary page.

It's an idea to give more power to calculated fields plugin.

Cheers!
runningC!
Donated!
Donated!
 
Posts: 12
Joined: Thu Jan 31, 2008 6:38 am

Postby HENNES » Thu Oct 28, 2010 11:06 am

runningC! wrote:Yes Hennes, that could be a good start for charting (but for number values you can already use standard ST reports).


With FIND THE BEST you can do more than charting - it sorts first and displays those in ranking towards the criteria.

Try it!

Just one (silly) example:
- select whatever activities
- FTB for TRIMP
- get them sorted & charted

much faster, better, different to acivity report:



Image



With the feature I'm thinking about you should be able to add a new "custom activity summary" where you can put those fields.


I have also suggested this to Vonni before - instead the graph show numbers and put them up on a ranking bar for all values which are monitored - I believe, this is in the making too....


Or do you mean something simply similar to this:



Image
rgds hennes
- kickbiking with FR 305 and STs 3

runner´s map ... EURE Karte für Laufveranstaltungen - zum MITMACHEN!!!
http://www.runnersmap.info
...mehr als DREI TAUSEND Laufveranstaltungen!
HENNES
Donated!
Donated!
 
Posts: 1185
Joined: Thu Feb 07, 2008 1:55 am
Location: Duesseldorf, Germany

Postby camel » Thu Oct 28, 2010 11:52 am

runningC! wrote:Yes Hennes, that could be a good start for charting (but for number values you can already use standard ST reports).

I was thinking about something more complicated. Suppose you'd like to monitor all those numbers coming from VO2max% Vdot and so on. With the feature I'm thinking about you should be able to add a new "custom activity summary" where you can put those fields. And again, if you want a page about splits and paces to monitor negative splits, you can do another custom activity summary page.

It's an idea to give more power to calculated fields plugin.

Cheers!


Hi,
it's not enought just to create new report with only your selected custom fields?

My way is just creating specialized reports for each set of custom fields.
And with new nearly integraded reports view with activity daily view it's easy to see activity detail pages and report at once.

Hm?

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

Postby dirk66 » Thu Oct 28, 2010 5:22 pm

Peter,

First i like to say thanks for writing this plugin. Great piece of work!

Is it possible to calculate with dates? I mean something like this:
{DISTANCE(sum,({DATE} - 01-01-2010))} Or is there a function available which gives the number of a day in a year. I already have a rolling sum for a year, but like to have a sum over this year. Up to now i use a non existing piece of equipment to achieve this, but a calculate plugin would be the place to do such a calculation ofcourse . :)

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

Postby camel » Fri Oct 29, 2010 2:15 am

dirk66 wrote:Peter,

First i like to say thanks for writing this plugin. Great piece of work!

Is it possible to calculate with dates? I mean something like this:
{DISTANCE(sum,({DATE} - 01-01-2010))} Or is there a function available which gives the number of a day in a year. I already have a rolling sum for a year, but like to have a sum over this year. Up to now i use a non existing piece of equipment to achieve this, but a calculate plugin would be the place to do such a calculation ofcourse . :)

Thanks
Dirk


Just very simple and little stupid implementation for this is:
Expression:
{DISTANCE(Sum,365)}
Condition:
{DATE}.Contains("2010")

But it's working :) Of course we can manipulate better with date, but syntax will be a little to C# (understand as hard).

But if you need to do with dates something else, just ask.
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby dirk66 » Fri Oct 29, 2010 3:10 am

Hi Peter,

Thanks. I guess i haven't expressed my self good. Or i'm thinking wrong. I like to have a rolling total of the current year. so on 1 jan only the amount of 1 jan and 31 dec. the amount of 1 jan - 31 dec. It now seems to count 365 days back when the activity itself is in the current year.
But unfortunately it doesn't count at all, i get an exception when using the formula you proposed:
Expression: ""26-6-2008".contains("2010")"cannot be evaluated, please use a valid C# expression. And
String does not contain a definitionfor contains and no extension method contains accepting a first argument of type string could be found (are you missing a using directive or an assembly reference?)

So probably i'm missing something. Although i have .net 1.1, 2.0, 3.0 and 3.5 installed. Is it an option to re-install 3.5?
dirk66
Donated!
Donated!
 
Posts: 534
Joined: Thu Feb 26, 2009 6:40 am
Location: Oss, Netherlands

Postby camel » Fri Oct 29, 2010 3:16 am

dirk66 wrote:Hi Peter,

Thanks. I guess i haven't expressed my self good. Or i'm thinking wrong. I like to have a rolling total of the current year. so on 1 jan only the amount of 1 jan and 31 dec. the amount of 1 jan - 31 dec. It now seems to count 365 days back when the activity itself is in the current year.
But unfortunately it doesn't count at all, i get an exception when using the formula you proposed:
Expression: ""26-6-2008".contains("2010")"cannot be evaluated, please use a valid C# expression. And
String does not contain a definitionfor contains and no extension method contains accepting a first argument of type string could be found (are you missing a using directive or an assembly reference?)

So probably i'm missing something. Although i have .net 1.1, 2.0, 3.0 and 3.5 installed. Is it an option to re-install 3.5?


I think that I understand you ok.

It will calculate summ for last 365 days. But it will apply conodition that date of activity must containt 2010.
So for example on 30. january it will find all activity 365 days to past.
But to sum calculation it will take only activities that have year 2010.
Perhaps you have a point.

You must write exactly this in condition:
{DATE}.Contains("2010")

You have written c with lower case. And that's a source of the error.
Fields of plugin are caseinsensitive, understand it as you can write lowercase or uppercase as you want between {}

But on other places it's case sensitive.

Compiler understands only Contains method. He doesn't know about contains method anything.
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby runningC! » Fri Oct 29, 2010 3:29 am

camel, hennes, I see your points. Both your suggestions are correct and interesting. I'm in some way already using specialized reports to view calculated fields, I'll give a try to "Find The Best".

Anyway I was thinking about something similar to the second option showed by hennes but not just the usual "Custom Data Fields" pane with ALL the fields: a specialized one with only the relevant info. Imagine how many calculated fields one can have if he/she continues playing with calculated fields ... I know, you can still view a selection through reports but that's a table not a pane. Don't you think a pane would be more ... elegant? ;)
runningC!
Donated!
Donated!
 
Posts: 12
Joined: Thu Jan 31, 2008 6:38 am

Postby dirk66 » Fri Oct 29, 2010 3:49 am

camel wrote:I think that I understand you ok.

It will calculate summ for last 365 days. But it will apply conodition that date of activity must containt 2010.
So for example on 30. january it will find all activity 365 days to past.
But to sum calculation it will take only activities that have year 2010.

You were right on this.

camel wrote:You must write exactly this in condition:
{DATE}.Contains("2010")

You have written c with lower case. And that's a source of the error.
Fields of plugin are caseinsensitive, understand it as you can write lowercase or uppercase as you want between {}

But on other places it's case sensitive.

Compiler understands only Contains method. He doesn't know about contains method anything.

:oops: Thanks, that helped.
dirk66
Donated!
Donated!
 
Posts: 534
Joined: Thu Feb 26, 2009 6:40 am
Location: Oss, Netherlands

Postby Xiaoan » Fri Oct 29, 2010 9:45 am

Hi,
first of all, great plugin!

I tried a few things and noticed the following:

I created 2 custom fields for displaying the fastest 3k and 5k in a run.
{MINPEAKDISTANCE(Elapsed,5000)} for example.
If there is a pause in the run, it doesn't count it as consecutive 5ks, so I have a few runs of over 5k that show me 0:00 minutes. Is there another way to calculate this that ignores the pauses? (I just stopped at a traffic light and pressed pause on my Garmin)

Greetings,

Andre
Xiaoan
 
Posts: 33
Joined: Wed Sep 29, 2010 4:37 am
Location: Maintal, Germany

Postby HENNES » Fri Oct 29, 2010 11:20 am

Xiaoan wrote:(I just stopped at a traffic light and pressed pause on my Garmin)


C´mon you cant be serious :twisted:

What is a traffic light?

The plugin does detect cheaters! :lol:
rgds hennes
- kickbiking with FR 305 and STs 3

runner´s map ... EURE Karte für Laufveranstaltungen - zum MITMACHEN!!!
http://www.runnersmap.info
...mehr als DREI TAUSEND Laufveranstaltungen!
HENNES
Donated!
Donated!
 
Posts: 1185
Joined: Thu Feb 07, 2008 1:55 am
Location: Duesseldorf, Germany

PreviousNext

Return to Calculated Fields

Who is online

Users browsing this forum: No registered users and 1 guest