Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
abc_18
Creator II
Creator II

how to calculate no of months in a year along with completed days

Hello everyone,

I have to get the count of no of months, which also includes no of passing days  in a month as well.

For example I have two months data:-April and May

April month is competed now, so for April count is 1, and

for May only 3 days are completed so it should be around 0.10 approx.

The total count which I should get is 1.10, but I am getting 1.97 by using below formula:-

 

=round((Count({<date={">=$(=Yearstart(Max(date),0,4))<=$(=Monthend(Max(date),0))"}>}distinct FMonth)


+(Count({<date={">=$(=Monthstart(Max(date)))<=$(=(Max(date)))"},fYear={"$(=Year(Today()))"} >}distinct date)
/
(Monthend(Max(date))-Monthstart(Max(date))))


- Count({<fYearMonth={"$(=Year(Today()) & Num(Month(Today()),00))"}>}distinct 1)),0.01)

 

Please suggest.

 

Regards

 

Labels (1)
1 Solution

Accepted Solutions
abc_18
Creator II
Creator II
Author

Hello,

your expression also give me value as '2', that is not correct, it should give something around 1.23 as May month is still not completed.

However I have achieved that by doing some modification in my expression.

Thanks for you help.

 

 

 

View solution in original post

2 Replies
javiersassen
Partner - Contributor III
Partner - Contributor III

Multiple ways that lead to ROme. You can try this for instance:

Sum(Aggr(Count({<date={"<$(=Today())"}>} date) / Count(date),FMonth))

abc_18
Creator II
Creator II
Author

Hello,

your expression also give me value as '2', that is not correct, it should give something around 1.23 as May month is still not completed.

However I have achieved that by doing some modification in my expression.

Thanks for you help.