Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
This is a simple question on SET analysis,
I am looking for an efficient method to find total days in a month from a date selection.
When user select a date, example PK_CALENDAR -> 6/7/2015 , the result is 31.
I have a master calendar has PK_CALENDAR, Month, Year
Solution 1: this one have problem if a selection date is xx/02/2015 or xx/02/2016- result 29
=(
MaxString({1<Month ={'$(=month(PK_CALENDAR))'}>}Day)//Day is month days
)
Solution2: Works perfect!
=(
Count({1<
Year = {'$(=Year(PK_CALENDAR))'}
,Month ={'$(=Month(PK_CALENDAR))'}
>}
DISTINCT PK_CALENDAR
)
)
Is there any other better solution?
Hi,
this can be achieved without set analysis.
=Floor(MonthEnd(CurrentDate)) - Floor(MonthStart(CurrentDate)) + 1
Hi,
this can be achieved without set analysis.
=Floor(MonthEnd(CurrentDate)) - Floor(MonthStart(CurrentDate)) + 1
Day(MonthEnd(Max(Date)))
Thank you
=floor(MonthEnd(PK_CALENDAR)-MonthStart(PK_CALENDAR))