Skip to Content
avatar image
Former Member

How to Calculate the First Day of the Curr Month Prev Year

I need following dates in webi

First Day of the Curr Month Prev Year - 01/10/2016

Last Day of the Curr Month Prev Year-31/10/2016

First Day of the Next Month Prev Year/Curr Year - 01/11/2016/ - 01/112017

Last Day of the Next Month Prev Year/Curr Year - 30/11/2016/ - 30/11/2017

Last Day of the Year Prev Year/Curr Year - 31/12/2016/ - 31/12/2017

Need help urgently

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 24, 2017 at 11:20 AM

    use these.

    First Day of the Curr Month Prev Year -

    =RelativeDate(ToDate("01/"+FormatDate(CurrentDate();"MM/yyyy");"dd/MM/yyyy");-12;MonthPeriod)

    Last Day of the Curr Month Prev Year-31/10/2016

    =LastDayOfMonth(RelativeDate(ToDate("01/"+FormatDate(CurrentDate();"MM/yyyy");"dd/MM/yyyy");-12;MonthPeriod))

    First Day of the Next Month Prev Year/Curr Year - 01/11/2016/ - 01/112017

    =RelativeDate(ToDate("01/"+FormatDate(CurrentDate();"MM/yyyy");"dd/MM/yyyy");-11;MonthPeriod)

    =RelativeDate(ToDate("01/"+FormatDate(CurrentDate();"MM/yyyy");"dd/MM/yyyy");1;MonthPeriod)

    Last Day of the Next Month Prev Year/Curr Year - 30/11/2016/ - 30/11/2017

    =LastDayOfMonth(RelativeDate(ToDate("01/"+FormatDate(CurrentDate();"MM/yyyy");"dd/MM/yyyy");-11;MonthPeriod))

    =LastDayOfMonth(RelativeDate(ToDate("01/"+FormatDate(CurrentDate();"MM/yyyy");"dd/MM/yyyy");1;MonthPeriod))

    Last Day of the Year Prev Year/Curr Year - 31/12/2016/ - 31/12/2017

    =RelativeDate(ToDate("31/12/"+FormatDate(CurrentDate();"yyyy");"dd/MM/yyyy");-1;YearPeriod)

    =ToDate("31/12/"+FormatDate(CurrentDate();"yyyy");"dd/MM/yyyy")

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 24, 2017 at 12:20 PM

    Thanks Amit ,

    but i dint want to hard code it .

    i have attached the screeshot , i need the data based on attached format. i have a date field. I am converting it into Week.

    suppose if reporting period is Oct-17 , then my general will be Jan-17 to oct 17 , direct will be nov 16 to dec 16 and flex will be Oct16.

    cap4.jpg

    Add comment
    10|10000 characters needed characters exceeded