Filter on Date Range in Use Chart

649 views
Skip to first unread message

saalmu...@gmail.com

unread,
Feb 18, 2021, 6:15:00 PM2/18/21
to golden-cheetah-users
Hi Ale, 

i'm trying to create a Cumulative distance per year chart where the individual data series should be the cumsum(DISTANCE) for individual years.

I found this example from Marc in an old thread mean(TSS["2015/01/01":"2015/12/31]) but it causes syntax error. 

This 
daterange("2020/01/01", "2020/05/01", metrics(DISTANCE));
doesn't work either.

How can i filter a date range in a user chart? 
 

Ale Martinez

unread,
Feb 18, 2021, 6:49:39 PM2/18/21
to golden-cheetah-users

saalmu...@gmail.com

unread,
Feb 18, 2021, 6:56:03 PM2/18/21
to golden-cheetah-users
Ah!     metrics(BikeStress, "2020/07/01", "2020/07/31")

Sorry for bothering you about it, Ale.

Thank you for your fast response!

Ale Martinez

unread,
Feb 18, 2021, 7:09:02 PM2/18/21
to golden-cheetah-users
El jueves, 18 de febrero de 2021 a la(s) 20:56:03 UTC-3, saalmu...@gmail.com escribió:
Ah!     metrics(BikeStress, "2020/07/01", "2020/07/31")

Sorry for bothering you about it, Ale.

Thank you for your fast response!

Honestly this is getting increasingly annoying for me. I tried several strategies s.t. to remind about forum guidelines or even to use some irony, but nothing seems to work.
Since, if I keep responding the cost to ask in the forum will continue to be lower than to RTFM, I will opt for not to answer anymore to users insisting on that behavior.

saalmu...@gmail.com

unread,
Feb 18, 2021, 8:07:17 PM2/18/21
to golden-cheetah-users
Well, i did search but overlooked the right spot - clearly my mistake.

saalmu...@gmail.com

unread,
Feb 19, 2021, 1:53:13 AM2/19/21
to golden-cheetah-users
My last question - for a long while, promise!

For a selected year in Trends I want to map a metrics vector (Date) with length being count(activities) to a new Date vector that has a data point for every day in the year (length = 365).
With seq i get that vector, but mapping the actual metrics to it is the problem.

I searched the forum properly plus the net. I get halfway there using the match() function to give me a vector of indices but am stuck there.  Things like complete(), CJ, joins  and other functions don't seem work.

The ultimate purpose is to create a metrics vector for Distance that has the actual distance for the activities and the distance of the previous not empty point for those dates where no activity exists. That last part i should be able to do with sapply.

Is there a way to do this within a User Chart?

Thanks, Ale. 

Ale Martinez

unread,
Feb 19, 2021, 6:25:05 AM2/19/21
to golden-cheetah-users
El viernes, 19 de febrero de 2021 a la(s) 03:53:13 UTC-3, saalmu...@gmail.com escribió:
My last question - for a long while, promise!

For a selected year in Trends I want to map a metrics vector (Date) with length being count(activities) to a new Date vector that has a data point for every day in the year (length = 365).
With seq i get that vector, but mapping the actual metrics to it is the problem.

I searched the forum properly plus the net. I get halfway there using the match() function to give me a vector of indices but am stuck there.  Things like complete(), CJ, joins  and other functions don't seem work.

The ultimate purpose is to create a metrics vector for Distance that has the actual distance for the activities and the distance of the previous not empty point for those dates where no activity exists. That last part i should be able to do with sapply.

Is there a way to do this within a User Chart?

Yes

saalmu...@gmail.com

unread,
Feb 19, 2021, 5:47:08 PM2/19/21
to golden-cheetah-users
Ok, don't tell me - let me try and figure it out ....

Ale Martinez

unread,
Feb 19, 2021, 9:38:22 PM2/19/21
to golden-cheetah-users
El viernes, 19 de febrero de 2021 a la(s) 19:47:08 UTC-3, saalmu...@gmail.com escribió:
Ok, don't tell me - let me try and figure it out ....

Great, post your solution here. Mine is included in the Energy Balance Chart.

saalmu...@gmail.com

unread,
Feb 21, 2021, 6:21:54 AM2/21/21
to golden-cheetah-users
Cumulative Distance per year.JPG
Hi Ale, 

- i don't think my version handles multiple activities on a single day
- the time shifting to align the curves is very inelegant 
- probably some other issues

but it looks like the graph i wanted.

I'll have a look how you did it tomorrow ....

Cheers
J

saalmu...@gmail.com

unread,
Feb 21, 2021, 6:32:06 AM2/21/21
to golden-cheetah-users
  I get an error when trying to post the gchart file. So here's the code for the 2019 series:



{
    init {
        xx<-c();
        yy<-c();
        FullYear<-seq(43464,43464+364,1);
        activities<-0;

}

    activity {
        # as we iterate over activities
        activities <- activities + 1;
    }

    finalise {
        # we just fetch metrics at the end
        ActivityDates       <- metrics(date,    "2019/01/01","2019/12/31");
        ActivityDistances   <- metrics(Distance,"2019/01/01","2019/12/31");



        # make a 365 long vector out of ActivityDistances

            # append distances and Dates
                Dates           <- c(FullYear+0.2,ActivityDates-0.2);
                AnnualDistance  <- c(rep(0,365),ActivityDistances);

            # sort and unique Distances and Dates by Dates
                 multisort(ascend, Dates, AnnualDistance);
                 Dates<- round(Dates);
                 multiuniq(Dates, AnnualDistance);

yy <- cumsum(AnnualDistance);


    }

    x { Dates+365; }
    y { yy; }
}

saalmu...@gmail.com

unread,
Sep 8, 2021, 3:53:27 AM9/8/21
to golden-cheetah-users
Hey Ale, 
as promised you haven't heard from me in a long time. I hope this finds you well?

I'm curios to know for what release and at what point in time the "Plan" function can be expected to be released?

Cheers
Juergen

Mark Liversedge

unread,
Sep 8, 2021, 6:23:44 AM9/8/21
to golden-cheetah-users
3.7.

There is a project here:

The e2e process is described here, with links to the deck:

I will likely to start with modelling adaptation before moving on to interventions and then the ui/ux for it (diary, automation etc)

Mark

saalmu...@gmail.com

unread,
Sep 8, 2021, 5:47:38 PM9/8/21
to golden-cheetah-users
Thanks, Mark !!

saalmu...@gmail.com

unread,
Apr 3, 2022, 8:45:16 PM4/3/22
to golden-cheetah-users

Hi Ale, 

I hope you're well. 

Recently transferred all GC from Win10 to Linux Mint. All athlete data, charts and layouts came across well and work, which is great.
The only thing i can't find is where the filters are stored. I have quite a number as well as "set" actions in there. How do i get those across to linux?

Also, is it possible to use an ERG file as a 'segment' or a power test so i can compare performance on the same ERG file over time?

Happy to open separate threads , let me know.

Cheers
Juergen
Reply all
Reply to author
Forward
0 new messages