Hi All,
I have an input file where in the first column I have dates. In this specific column there are always two different dates (as file relates to WoW comparison).
I need to add a step when I delete all of the rows related to prior date as presented below.
Please note number of the rows are not constant and I always need to delete prior date data so relevant date will change for every week/run.
Hope you can help me out here. 🙂
Input:
Date | Code |
2021.03.12 | xyz |
2021.03.12 | abc |
2021.03.12 | wrsfswf |
2021.03.12 | sfdsa |
2021.03.12 | sdfv |
2021.03.12 | sdfv |
2021.03.12 | sdfv |
2021.03.19 | sac |
2021.03.19 | sdc |
2021.03.19 | sadc |
2021.03.19 | favvgf |
2021.03.19 | fgbbngh |
Necessary outcome:
Date | Code |
2021.03.19 | sac |
2021.03.19 | sdc |
2021.03.19 | sadc |
2021.03.19 | favvgf |
2021.03.19 | fgbbngh |
Many thanks,
Agi
Solved! Go to Solution.
Hi @agnesr,
You will need to parse the date field into the Alteryx date format, summaris to find the max date of the dataset, append this back and filter for records where the date = max date in the dataset:
If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.
Regards,
Jonathan
Another slightly simpler approach is to convert the date and find the max date. Then join the max date back to the output of the date conversion using the converted date as the join key. By the way, in your example you didn't need to convert the date since the format of date strings you used would sort correctly. But it generally is best practice to convert date strings to make sure you do get the correct sort order.
Nice one @TonyA! I always seem to forget about the join condition approach!
Thank you both for the prompt solutions, I tried second one and worked smoothly.
To be honest I skipped the DateTime tool as previously I set data type to date using select tool.
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |