Skip to Content
avatar image
Former Member

WebI work out previous months

Hi

I am trying to set up a report so that every time I run it the headings will be for the past 6 months e.g.

Current month: March

So the report headings should so: Feb, Jan, Dec, Nov, Oct, Sep

Then when run in May, headings should update to: Apr, March, Feb, Jan, Dec, Nov

Any tips?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 13, 2017 at 11:33 AM

    Try this.This is not very good solution but your problem will be resolve with this.

    You need to create 6 variables.One for one month display.

    I have create for Current Date-6=If(MonthNumberOfYear(CurrentDate())=1) Then "Aug" ElseIf(MonthNumberOfYear(CurrentDate())=2) Then "Sep" ElseIf(MonthNumberOfYear(CurrentDate())=3) Then "Oct" ElseIf(MonthNumberOfYear(CurrentDate())=4) Then "Nov" ElseIf(MonthNumberOfYear(CurrentDate())=5) Then "Dec" ElseIf(MonthNumberOfYear(CurrentDate())=6) Then "Jan" ElseIf(MonthNumberOfYear(CurrentDate())=7) Then "Feb" ElseIf(MonthNumberOfYear(CurrentDate())=8) Then "Mar" ElseIf(MonthNumberOfYear(CurrentDate())=9) Then "Apr" ElseIf(MonthNumberOfYear(CurrentDate())=10) Then "May" ElseIf(MonthNumberOfYear(CurrentDate())=11) Then "Jun" ElseIf(MonthNumberOfYear(CurrentDate())=12) Then "Jul"

    Similarly you can create for current month-5 and for others.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 13, 2017 at 07:59 AM

    Hi Amit,

    Sorry still getting to grips with the forum and didn't realise it takes a day or so to get the question uploaded.

    We are using an older version where I am not able to use the MonthPeriod function.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 04, 2017 at 08:56 AM

    Amit - Thank you so much! That has worked perfectly.

    Add comment
    10|10000 characters needed characters exceeded