Skip to main content
May 17, 2023

Daily Average Calc

  • May 17, 2023
  • 4 replies
  • 1 view

Does anyone know how to write a formula that calculates an average based on the POV's number of days? Thanks

4 replies

May 17, 2023

you can access the number of days like this:

BrApi.Finance.Time.GetNumDaysInTimePeriod(si, timeId)

or in a finance business rule or member formula:

api.Time.GetNumDaysInTimePeriod(timeId)

May 17, 2023

Thanks Christian!  Do you happen to have a sample?  Thanks in advance

May 17, 2023

 

 

 

Dim timId as Integer = BrApi.Finance.Members.GetMemberId(si, DimTypeId.Id, “2023M1”)
Dim numDays = BrApi.Finance.Time.GetNumDaysInTimePeriod(si, timId)

Dim timId as Integer = api.Members.GetMemberId(DimTypeId.time, “2023”)
Dim numDays as Integer = api.Time.GetNumDaysInTimePeriod(timeId)