Calculated Fields

by camel

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

Version:

1.2.9.4

Updated:

Apr 11, 2011

Want to disply IF value

Want to disply IF value

Postby Burnt Toast » Thu Mar 21, 2013 9:06 am

I'm having problems getting an IF value to calculate for disply purposes in daily summary pane. I keep getting an error and have no idea why its not working. Can anyone help me figure this out?

Error:
Image
Burnt Toast
Donated!
Donated!
 
Posts: 666
Joined: Thu Apr 29, 2010 9:21 am
Location: Minnesota, USA

Re: Want to disply IF value

Postby dirk66 » Thu Mar 21, 2013 4:53 pm

Hi

Your expression fails because your norm.power field somehow contains a null value. If you place ({Norm.Power} !=null) in the condition field, the expression won't fail because it won't be executed.

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

Re: Want to disply IF value

Postby Burnt Toast » Thu Mar 21, 2013 7:33 pm

dirk66 wrote:Hi

Your expression fails because your norm.power field somehow contains a null value. If you place ({Norm.Power} !=null) in the condition field, the expression won't fail because it won't be executed.

Succes
Dirk

I tried it with a space before the ! and without, both senarios returned the same error
Image
Burnt Toast
Donated!
Donated!
 
Posts: 666
Joined: Thu Apr 29, 2010 9:21 am
Location: Minnesota, USA

Re: Want to disply IF value

Postby dirk66 » Fri Mar 22, 2013 8:04 am

The problem you run into is that your custom fields NormPwr en FTPcycle both can be empty and in that case the execution fails. The execution of this formula will also fail if FTPcycle will be zero.
Therefore you have to be sure that both fields aren't null and ftpcycle isn't 0 either.

I don't use both fields, For your problem yesterday i managed to get it working but today and ftpcycle empty and normpower empty i also get an error message. Somehow the Linq interpretor doesn't like conditions like these: ({NormPwr} !=null)&&({FTPcycle} !=null)&&({FTPcycle} !=0) but like these: ({DISTANCE} != 0) && ({AVGHR} != 0) && {CATEGORY}.Contains("Roeien")

Where NormPwr and FTPcycle are custom fields and DISTANCE etc are core ST fields. I'm afraid i can't help you on this. I think Peter, the plugin author, has to help.
btw It is possible that your definition of FTPcycle and NormPwr are different from mine.
dirk66
Donated!
Donated!
 
Posts: 534
Joined: Thu Feb 26, 2009 6:40 am
Location: Oss, Netherlands

Re: Want to disply IF value

Postby Burnt Toast » Fri Mar 22, 2013 2:26 pm

Thanks for the help, I'm totally over my head on this.

I'm getting the Norm. Power and FTPcycle from the Training Load plugin. I noticed that someone else was displaying the cycling IF field and asked what he was using for a formula. He gave me this:
{NormPwr}/{FTPcycle}

That seemed easy enough so I gave it a try by typing it in and got an error. I then figured out how to navigate out to the field I wanted and insert it into the expression box, but my custom field was different. I had "Normal Power" instead of NormPwr. I think I may have changed the name years ago before I even thought about how or why I would use that figure. I changed the name back to "NormPwr" and still go the error. I removed TL and and the custom field, then reloaded it so TL would recreate the Normal Power custom field. This time around the field was named "Norm. Power" so I left it alone and tried to use that one but it still failed.

I'm a bit confused on the processing though. If I create the calculated field IF, add an expression to it, update and test it, what is the test doing? Is it running every activity to check if the fields are present and filled with a value?

MTA:
Also the number 124.xxxxxxxx in the screen shot above it the number that is in the {Norm. Power} power field but for some reason it gets stuck on it. I tried again after your post and got the test to work when I added your condition, but when I ran it, it worked up until activity number 642 of 2000 something activities. The first 641 activities calculated just fine.


dirk66 wrote:The problem you run into is that your custom fields NormPwr en FTPcycle both can be empty and in that case the execution fails. The execution of this formula will also fail if FTPcycle will be zero.
Therefore you have to be sure that both fields aren't null and ftpcycle isn't 0 either.

I don't use both fields, For your problem yesterday i managed to get it working but today and ftpcycle empty and normpower empty i also get an error message. Somehow the Linq interpretor doesn't like conditions like these: ({NormPwr} !=null)&&({FTPcycle} !=null)&&({FTPcycle} !=0) but like these: ({DISTANCE} != 0) && ({AVGHR} != 0) && {CATEGORY}.Contains("Roeien")

Where NormPwr and FTPcycle are custom fields and DISTANCE etc are core ST fields. I'm afraid i can't help you on this. I think Peter, the plugin author, has to help.
btw It is possible that your definition of FTPcycle and NormPwr are different from mine.
Burnt Toast
Donated!
Donated!
 
Posts: 666
Joined: Thu Apr 29, 2010 9:21 am
Location: Minnesota, USA

Re: Want to disply IF value

Postby dirk66 » Fri Mar 22, 2013 5:27 pm

To my knowledge the test function runs about the last or first 30 or so activities with the formula you typed in. Calculate selected rows, runs the selected formula's for every activity in your logbook.
Your formula is correct. The problem is the data. Somewhere in your activities or in your athlete data there are entries without a norm power or without a ftpcycle value. Or without both. To avoid a failure you have to enter a condition. When i tried to enter a condition where both norm power and ftpcycle are checked against null the linq interpreter doesn't accept this. Or the plugin code doesn't. (i don't have the code, so i'm not sure about this) It might be a bug or a misunderstanding how this plugin works.
In my case, whenever ftpcycle is empty, normpower is also empty. I don't know if this is the case in your logbook. But if so then ({FTPcycle} !=null) in the condition field might be a shortterm solution. Although the correct solution still is both fields checked on !=null and ftpcycle checked on !=0 or maybe >0

Aparently activity 642 doesn't have a ftpcycle value. Or better: it matches a period in your athlete data in where you don't have a proper ftpcycle value.
dirk66
Donated!
Donated!
 
Posts: 534
Joined: Thu Feb 26, 2009 6:40 am
Location: Oss, Netherlands


Return to Calculated Fields

Who is online

Users browsing this forum: No registered users and 2 guests