4 Replies Latest reply on Aug 6, 2013 6:37 AM by larsheise

# Recurring custom function challenge

I have given up and hope for some help.

I need at custom function in this format

WeeksVisit ( starting_date ; Interval )

It should be recursive and calculate the week numbers for the coming visits.

if we enter the date 13/8/6 (today) - and the interval of 90 the result should be 32¶5¶18¶31

32 ( week for today )

5 ( for date 13/11/4 90 days from today)

18 ( for date 14/2/2 - 90 days from last date )

31 ( for date 13/8/1 - 90 days from last date )

Now it shoud stop - only show week numbers for the coming year.

For info I have calculated the week-numbers with this formula WeekOfYearFiscal ( date ; 2 )

(belive this is how it is done in Europe)

Hope somebody can help out here

Best regards Lars

• ###### 1. Re: Recurring custom function challenge

See if this CF helps you.

• ###### 2. Re: Recurring custom function challenge

Unfortunately, I don't think so.

by entering 7 in the interval I should get all weeks - but I do not.

To me it seems that "myResult" never updates. Tried to add a new record - same result

Shouldn't "myStartDate" be of date format ?

• ###### 3. Re: Recurring custom function challenge

larsheise wrote:

Shouldn't "myStartDate" be of date format ?

Now that you mention it … feel free to tweak it.

If you're unsure how to write a recursive CF, this might at least give you a start.

• ###### 4. Re: Recurring custom function challenge

Problem solved.

I think I understand your custom funcion and the recurring part.

I tweaked it a little - so that myExitCondition = start date + 1year - instead of the static date.

Thanks very much for your help.

Best regards

Lars