Using date Ranges in DR Functions

  • It's possible to create ranges for dates, whole or decimal numbers when part of a DR.GET function.
  • Such ranges can be added as parameters using the DR.Range function in the Excel Add-in.
  • The DR.Range function is not applicable for text or boolean (true/false) data types.

Use Case

Let's say your organization works on a 4-4-5 schedule (or any unique fiscal year), then you can use the Dynamic Ranges to give you more flexibility in how you calculate your reports. 

DR.Range Syntax

The basic syntax for DR.Range is DR.Range (Value1, Value2).
Here are some examples.

Required Range Syntax
Dates between 01/01/21 and 8/31/2021 DR.Range(DR.Date(“01/01/2021”),DR.Date(“08/21/2021”)
Account Numbers between 4000 to 5000 DR.Range(4000,5000)
Excel Cell Ranges A2…A5 (can be date or number data types) DR.Range(A2, A5)

The function DR.Range requires DR.Date when using a range of hard coded dates. If Excel cell ranges are used, then DR.Range does not require DR.Date.

Syntax for DR.Range in a DR.Get Function

The syntax to get the value of the field ‘Amount’ between the start dates 1 January 2021 and 31 August 2021 is:

DR.Get(Amount,"[StartDate]".DR.Range(DR.Date(“01/01/2021”),DR.Date(“08/31/2021”)))

Create a DR.Range Expression Using the Field Selector

Example: We shall enter the function using the DataRails Field Selector. The function will fetch values within the date range 1 January 2019 and May 1 2019.

  1. Click the cell where you want the function.
  2. Go to the Excel formula bar, right-click and select DataRails > Parameters.
    excel_addin_formula_bar.png
  3. The Field Selector dialog box opens. Complete the Field Selector as shown.
    excel_addin_date_range_field_selector.png
  4. Select a field with the correct data type (date, whole number or decimal). In this example the field selected is Period.
  5. Checkmark the start date and the end date.
  6. Select Values in Range (DR.Range).
  7. Check mark Add as last parameter.
  8. Click OK. The completed function will appear in the formula bar.

Use the reference date (date picker) in DR Formulas

date_picker_excel_ribbon_2_locations_123.png

  1. The Reference date (Date Picker) applies a date filter to a dataset. The filter is available in three (3) locations:
    • DataRails ribbon Filter>Add Date Picker
    • DataRails ribbon as a hyperlink (see the above image)
    • Dashboard header
  2. When you select a date, you can select the time dimension (time range) for the filter.
    For example, today, month to date, year to date, quarter to date and so on).
  3. You can then use the DR function DR_DATE_PICKER in a formula and it will return the data based on the date range you have set.
  4. Example: Your formula might be =EOMONTH(DR_DATE_PICKER,-1).
  5. To update the date for a different date range, simply change the date using Date Picker.



© Datarails Ltd. All rights reserved.

Updated

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.