-1

I have a flow that creates a collection of dates of birth. my goal is to add them together and divide by the count to get the average date of birth. the amount of DOBs in the collection can change dynamically meaning count will change depending on the account structure.

This is required for some business MI

I am new to flows but i cant find a solution even remotely similar anywhere i've looked. Ideally avoiding apex code, i do not have permissions to implement this. Any help is welcome! Thankyou

1 Answer 1

2

This is not a complete solution, but I ran out of room in a comment. You could loop through the collection and assign two variables one for the count of records, and one for the sum of the dates, then after the loop, you can have a formula that does the math.

In a formula convert the date to a number like excel does, the number of days from 1/1/1900 to the date. so if we had today (8/8/23) the number of days is 45,144. If you had 5 days 8/5/23, 8/6/23, 8/7/23, 8/8/23, 8/9/23 would work like this:

(45141 + 45142 + 45143 + 45144 + 45145) / 5 = 45143

Then convert the number back to a date add the number of days to 1/1/1900 which gives you 8/7/23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .