# Qlik Sense App Development

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for
Did you mean:
Highlighted
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)

Regards

Labels (1)
• ### working days

1 Solution

Accepted Solutions
Highlighted
Creator II

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.

2 Replies
Highlighted
Partner

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

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

Highlighted
Creator II

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.