Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Multiple IF condition for Date and time

Pankhudri20
8 - Asteroid

Hello,

I have a per second data for each day and I would like to define a condition where any row which falls on a "Friday 12 am to 3pm" should be removed.

 

Can you please tell how can I achieve this in alteryx?

I have tried a lot of datetime functions and nothing seems to be working.

 

Thank you

Regards,

Pankhudri 

38 REPLIES 38
atcodedog05
22 - Nova
22 - Nova

Hi @Pankhudri20 

 

You can regex like below to capture the filename.

REGEX_Replace([FileName],".*(\d{1,2}-\d{2})-\d{4}-\d{2}-\d{2}.*","$1")

 

Workflow:

atcodedog05_0-1627477436933.png

 

Hope this helps : )

Pankhudri20
8 - Asteroid

So will it capture both '1-11-' and '13-22-' types of files? 

I want to capture only '1-11-' in one workflow and '13-22-' in another workflow.

 

Regards,

Pankhudri

 

atcodedog05
22 - Nova
22 - Nova

Hi @Pankhudri20 

 

Yes, use a filter to isolate to a specific type similar to filtering filenames after 1st June.

Pankhudri20
8 - Asteroid

Hello @atcodedog05 ,

 

I am sorry for troubling so much!

Since I am new to Regex expressions, I used this expression in the Categorize and it is working perfectly for 1-11 but not retrieving any files when I choose 13-22.

 

REGEX_Replace([FileName],".*(\d{1,2}-\d{2})-\d{4}-\d{2}-\d{2}.*","$1"

Can you please tell me if any change is required in the expression for 13-22?

I tried changing the expression but it is not taking 13-22.

 

Any help would be really appreciated.

Thank you

Regards,

Pankhudri Agrawal

 

apathetichell
18 - Pollux

assuming 13-22 files have the same structural components as  1-11 - the regex should be the same... is the "-" there and does the date in yyyy-mm-dd follow 13-22? are there any numbers before that 13?

Pankhudri20
8 - Asteroid

Hello @apathetichell ,

The format is exactly the same as 1-11.

Only 1-11 is replaced by 13-22.

But the expression is not evaluating 13-22. It is taking 3-22.

 

Regards,

Pankhudri

apathetichell
18 - Pollux

o.k. - quick fix:

try:

1) swap \d{1,2} for \d+

if that doesn't work try:

2) add a $ right before closing quote so it reads as ".*$"

 

If neither works let me know and I'll post a more detailed expression.

Pankhudri20
8 - Asteroid

Hello @apathetichell ,

 

Thank you soo much!

 

The 1st options worked well here.

Thanks a lot again!

 

Regards,

Pankhudri 

atcodedog05
22 - Nova
22 - Nova

Hi @Pankhudri20 

 

That's strange it should have worked. Anyways i can see @apathetichell has helped you in the situation 🙂.

Labels