
I have a workflow in Tableau Prep. I have two objectives:
- Filter out the last two months of the dataset
- Filter out the first two months of the dataset
I have a Date field. Every month when I refresh the workflow, I will always require the first two months and last two months to be filtered out the dataset
Please can you advise the best way to do this? Thank you
@Matthew Healey
Hi, you may take a look of the proposed flow. The high level steps:
a. DATETRUNC to month the Date
b. Obtain a Rank for the data trunc month order ascend with RANK_DENSE
{ORDERBY [DATETRUNC] ASC:RANK_DENSE()}c. Obtain a Rank for the data trunc month order descend with RANK_DENSE
{ORDERBY [DATETRUNC] DESC:RANK_DENSE()}e. Remove the 1 and 2 rank for each of the ranks.
[TOP ascend]>=3 AND [TOP descend]>=3
Attached you will find the example flow.
If this post resolves the question, would you be so kind to "Select as Best"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.
Regards,
Diego Martinez
Tableau Visionary and Forums Ambassador