Displays the data between the time frame specified. Can be used to display months, quarters, and year periods.
| NAME | DESCRIPTION |
|---|---|
| MONTHPERIOD | Shows the months between the specified periods |
| QTRPERIOD | Shows the quarters between the specified periods |
| YEARPERIOD | Shows the years between the specified periods |
| LASTNDAY | Returns data for last n days |
| LASTNMONTH | Returns data for last n months |
| LASTNQTR | Returns data for last n quarters |
| LASTNYEAR | Returns data for last n years |
The SHOWBETWEENPERIOD(MONTHPERIOD) function can be used to display data for a particular month or a range of months.
SHOWBETWEENPERIOD(MONTHPERIOD(year, from_month, to_month))
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.
SHOWBETWEENPERIOD(MONTHPERIOD(2023,2,8)) #Displays the 2023 data between Feb and August
SHOWBETWEENPERIOD(MONTHPERIOD(2023,10)) #Displays the data for 2023 October
.png)
SHOWBETWEENPERIOD - MONTHPERIOD
The SHOWBETWEENPERIOD(QTRPERIOD) function can be used to display data for a particular quarter or a range of quarters.
SHOWBETWEENPERIOD(QTRPERIOD(year, from_qtr, to_qtr))
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.
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
.png)
SHOWBETWEENPERIOD - QTRPERIOD
The SHOWBETWEENPERIOD(YEARPERIOD) function can be used to select data for a particular year or a range of years.
SHOWBETWEENPERIOD(YEARPERIOD(start_year, end_year))
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.
SHOWBETWEENPERIOD(YEARPERIOD(2021,2023)) #Displays the data between 2021 and 2023
SHOWBETWEENPERIOD(YEARPERIOD(2023)) #Displays the data for 2023
.png)
SHOWBETWEENPERIOD - YEARPERIOD
The SHOWBETWEENPERIOD(LASTNDAY) function can be used to display data for a specified number of days preceding the current day.
SHOWBETWEENPERIOD(LASTNDAY, number_of_days)
number_of_days – The number of days for which to fetch data. Required.
SHOWBETWEENPERIOD(LASTNDAY, 15) #Displays data for the past two weeks
The SHOWBETWEENPERIOD(LASTNMONTH) function can be used to select data for a specified number of months preceding the current month.
SHOWBETWEENPERIOD(LASTNMONTH, number_of_months)
number_of_months – The number of months for which to fetch data. Required.
SHOWBETWEENPERIOD(LASTNMONTH, 5) #Displays data for the past 5 months
.png)
SHOWBETWEENPERIOD - LASTNMONTH
The SHOWBETWEENPERIOD(LASTNYEAR) function can be used to select data for a specified number of years preceding the current year.
SHOWBETWEENPERIOD(LASTNYEAR, number_of_years)
number_of_years – The number of years for which to fetch data. Required.
SHOWBETWEENPERIOD(LASTNYEAR, 2) #Displays data for the past 2 years
.png)
SHOWBETWEENPERIOD - LASTNYEAR
The SHOWBETWEENPERIOD(NEXTNDAY) function can be used to select data for a specified number of days after the current day.
SHOWBETWEENPERIOD(NEXTNDAY, number_of_days)
number_of_days – The number of days for which to fetch data. Required.
SHOWBETWEENPERIOD(NEXTNDAY, 8) #Displays data for 8 days from current date