Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
alkesh_sharma
Creator III
Creator III

How to return Day of current month or total no. of days for any other selection

Hello,

is there a way which will return me current day of current month but if I select previous months. should give me max no of days in that month.

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi,

Try like this.

In you year and month list box select always one possible value.

write below expression.

=if(GetFieldSelections(Month)=month(today()) and GetFieldSelections(Year)=year(today()) ,date(today()),count(Day))

Look at the attached file

View solution in original post

15 Replies
ashfaq_haseeb
Champion III
Champion III

Hi try

=Max(Date_Field) in text box.

Regards

ASHFAQ

alkesh_sharma
Creator III
Creator III
Author

This will give me Maximum day of the current month.

What I need is:

Day(Today) will give me the current date of today. but if I select previous month it should return me 30/31

I

avinashelite

Hi Alkesh,

If you trying to calculate number of working days use networkingdays()

sudeepkm
Specialist III
Specialist III

you can use MonthEnd() function. when you select previous month any date the monthend() function will return the last day of the month.

avinashelite

Try this

=day(max(Date))

ashfaq_haseeb
Champion III
Champion III

Hi,

Try like this.

In you year and month list box select always one possible value.

write below expression.

=if(GetFieldSelections(Month)=month(today()) and GetFieldSelections(Year)=year(today()) ,date(today()),count(Day))

Look at the attached file

alkesh_sharma
Creator III
Creator III
Author

Thanx Ashfaq...

It Worked!

ashfaq_haseeb
Champion III
Champion III

Hi,

Can you close this thread.

Regards

ASHFAQ

alkesh_sharma
Creator III
Creator III
Author

Sure sure.. just one more help.... What if I need to select more than one month..

For example....

If I select May and July both at once: the output should be 31 days of May + 10 Days of July so that output should be 41 days!!!

would it be possible....???