SHOWBETWEENPERIOD

Displays the data between the time frame specified. Can be used to display months, quarters, and year periods.

NAMEDESCRIPTION

Shows the months between the specified periods

Shows the quarters between the specified periods

Shows the years between the specified periods

Returns data for last n days

Returns data for last n months

Returns data for last n quarters

Returns data for last n years

1. SHOWBETWEENPERIOD(MONTHPERIOD)

The SHOWBETWEENPERIOD(MONTHPERIOD) function can be used to display data for a particular month or a range of months.

Syntax

SHOWBETWEENPERIOD(MONTHPERIOD(year, from_month, to_month))

Arguments

year – The year for which data has to be fetched. Required.

from_month – The month for which data has to be fetched or the start month if a range is specified. Values can be between 1 and 12. Required.

to_month - The end month when a range of data has to be fetched. Values can be between 1 and 12. Optional.

Example

SHOWBETWEENPERIOD(MONTHPERIOD(2023,2,8)) #Displays the 2023 data between Feb and August
SHOWBETWEENPERIOD(MONTHPERIOD(2023,10)) #Displays the data for 2023 October

2. SHOWBETWEENPERIOD(QTRPERIOD)

The SHOWBETWEENPERIOD(QTRPERIOD) function can be used to display data for a particular quarter or a range of quarters.

Syntax

SHOWBETWEENPERIOD(QTRPERIOD(year, from_qtr, to_qtr))

Arguments

year – The year for which data has to be fetched. Required.

from_qtr – The quarter for which data has to be fetched or the starting quarter if a range is specified. Values can be between 1 and 4. Required.

to_qtr - The end quarter when a range of data has to be fetched. Values can be between 1 and 4. Optional.

Example

SHOWBETWEENPERIOD(QTRPERIOD(2023,2,4)) #Displays the 2023 data between the 2nd and 4th quarter
SHOWBETWEENPERIOD(QTRPERIOD(2023,3)) #Displays the data for the 3rd quarter of 2023

3. SHOWBETWEENPERIOD(YEARPERIOD)

The SHOWBETWEENPERIOD(YEARPERIOD) function can be used to select data for a particular year or a range of years.

Syntax

SHOWBETWEENPERIOD(YEARPERIOD(start_year, end_year))

Arguments

start_year – The year for which data has to be fetched or the starting year if a range is specified. Values should be in YYYY format. Required.

end_year- The end year when a range of data has to be fetched. Values should be in YYYY format. Optional.

Example

SHOWBETWEENPERIOD(YEARPERIOD(2021,2023)) #Displays the data between 2021 and 2023
SHOWBETWEENPERIOD(YEARPERIOD(2023)) #Displays the data for 2023

4. SHOWBETWEENPERIOD(LASTNDAY)

The SHOWBETWEENPERIOD(LASTNDAY) function can be used to display data for a specified number of days preceding the current day.

Syntax

SHOWBETWEENPERIOD(LASTNDAY, number_of_days)

Arguments

number_of_days – The number of days for which to fetch data. Required.

Example

SHOWBETWEENPERIOD(LASTNDAY, 15) #Displays data for the past two weeks

5. SHOWBETWEENPERIOD(LASTNMONTH)

The SHOWBETWEENPERIOD(LASTNMONTH) function can be used to select data for a specified number of months preceding the current month.

Syntax

SHOWBETWEENPERIOD(LASTNMONTH, number_of_months)

Arguments

number_of_months – The number of months for which to fetch data. Required.

Example

SHOWBETWEENPERIOD(LASTNMONTH, 5) #Displays data for the past 5 months

6. SHOWBETWEENPERIOD(LASTNYEAR)

The SHOWBETWEENPERIOD(LASTNYEAR) function can be used to select data for a specified number of years preceding the current year.

Syntax

SHOWBETWEENPERIOD(LASTNYEAR, number_of_years)

Arguments

number_of_years – The number of years for which to fetch data. Required.

Example

SHOWBETWEENPERIOD(LASTNYEAR, 2) #Displays data for the past 2 years

7. SHOWBETWEENPERIOD(NEXTNDAY)

The SHOWBETWEENPERIOD(NEXTNDAY) function can be used to select data for a specified number of days after the current day.

Syntax

SHOWBETWEENPERIOD(NEXTNDAY, number_of_days)

Arguments

number_of_days – The number of days for which to fetch data. Required.

Example

SHOWBETWEENPERIOD(NEXTNDAY, 8) #Displays data for 8 days from current date

Last updated