I have [ReportingMonth] = [1,2,3,4,5,6,7,8,9,10,11,12] as a field which is type Number and I also have [ReportingYear] = [2013,2014,2015,2016] type Number
I want to calculate # of days in Month. I want for current year & month to calculate # of days as of today but for all prior months of previous years to be calculated as full months.
I am using below formula in WEBI and getting # of days accurately. How would I do something similar in HANA as a calculated column?
-----------------------------------------------------------------------
=If (FormatNumber([ReportingMonth];"00")=FormatNumber(MonthNumberOfYear(CurrentDate());"00"))
And
(FormatNumber([ReportingYear];"0000")=FormatNumber(Year(CurrentDate());"0000"))
Then DayNumberOfMonth(CurrentDate())
Else DayNumberOfMonth(LastDayOfMonth(ToDate([MMYYYY];"MMyyyy")))
------------------------------------------------------------------------