Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Checking if today's date exists in the date column then deleting the row containing it

ryanbedran7
5 - Atom

Hello,

I am new to Alteryx, I have a column called Date which contains several dates I want to see if today's date exists in this column and if it does then I want to delete the row containing this date however from a second excel sheet. I tried using the filter condition but without any luck. Im able to get today's date with the filter but I want to execute the true condition if the date exist and not both true and false. 

Thank you

6 REPLIES 6
Jay-RDC
8 - Asteroid

You might want to start with a formula tool and use If datetimeformat(datetimenow(),"%Y-%m-%d") = [date] then "True" else "False" endif. 

ryanbedran7
5 - Atom

I did something similar with 1 and 0 but what I noticed is that the filter tool is separating the columns with 1 in true and the ones with 0 in false but when I run the true and false outputs of the filter are outputted and not just one of them. What I want to achieve is if todays date exists then only output the file without the date column and if todays date does not exist then output the same file but not both. I have attached a screenshot of the filter tool output true.

Jay-RDC
8 - Asteroid

Hi. I'm still unclear of what you're trying to do. But if the problem is just the output columns, you can just select the columns you want to pass through the data stream using the Select Tool. 

ryanbedran7
5 - Atom

Let me clarify.

I have an input sheet containing a date column.

If today's date is one of the cells of this date column then I want to delete the row containing this date

If today's date is not present in the date column then I want to output the file as is

Jay-RDC
8 - Asteroid

So what you can do is use a formula tool. If datetimeformat(datetimenow(),"%Y-%m-%d") = [date] then null() else [date] endif. Then use a data cleansing tool to remove null values to your output.

DataNath
17 - Castor

@ryanbedran7 your approach with the filter tool here is perfect. Whilst the filter tool will split your data into true and false as you say, if you only continue on your data stream/flow from one of those anchors then that’s all that will be in the output. If you don’t want the true (where date = today’s date) then you’d just continue processing from the false anchor and eventually output. As you haven’t done anything with the True output, that will go nowhere and not end up in the final output.

Labels