The following instructions detail how to create a flag (a new logical column) in Exploratory to identify whether dates in a date column fall within the last three months from the current date or from the last data point in that column.
To create a flag that identifies if a date is within the last three months, first click the header of the date column you wish to flag and select “Replace Values With Conditions”.
When the “Create Calculations or Replace Values with Conditions” dialog opens, click the “Add Condition” button.
Once the “Condition” dialog is displayed, specify the following. This applies when determining the last 3 months starting from today.
- Column : Select your date column.
- Operator : Select “Relative Date Filter”.
- Date Type : Select “Month”.
- How to Set Value : Select “Recent N Months”.
- Value : Enter “3”.
If you want to specify the last 3 months based on the last date in the column, in the “Condition” dialog, click the “How to Set Value” dropdown menu and select “Data’s Last N Months”.
Next, set the values to be assigned to the new column.
Back in the “Create Calculations or Replace Values with Conditions” dialog, if the condition created previously is met (indicating the date is within the last 3 months), click the “Return Values” dropdown menu and select “T / F (TRUE / FALSE)”, then choose “TRUE”. Otherwise (for the default value), click the “Default Value” dropdown menu, select “T / F (TRUE / FALSE)”, and choose “FALSE”.
Finally, enter “Last_3_Months” as the name for the new column. Ensure “Create New Column” is selected, then click the “Run” button to create the new flag column.
This will create a flag column that indicates whether a date is within the last 3 months.