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.
SOLVED

Disable Container Based on Date

Adrian01
6 - Meteoroid

I'm basically wanting to disable a container based on Today's day. I've tried multiple setups but I can't seem to get the container to disable. If it is not Saturday then remain enabled, vice-versa. 

7 REPLIES 7
fmvizcaino
17 - Castor
17 - Castor

Hi @Adrian01 ,

 

You were almost right. The only thing you need to update is your condition formula to:

DateTimeFormat(datetimetoday(),"%A")='Saturday'

 

Let me know if that works for you.

Best,

Fernando Vizcaino

Adrian01
6 - Meteoroid

I changed the condition to test for the day being "Tuesday" but the container still has a text output. I have tested the IFF condition in a formula tool on another workflow and it outputs as "True" when I change it to "Tuesday".

 

What am I doing wrong? Or is there a better way to basically shut off this input from processing?

 

DavidP
17 - Castor
17 - Castor

Here's how I did it.

 

disable container 1.pngdisable container 2.png

fmvizcaino
17 - Castor
17 - Castor

Hi @Adrian01 ,

 

Remove the iif clause from the condition and leave the formula as:

DateTimeFormat(datetimetoday(),"%A")='Tuesday'

It will work this way.

Adrian01
6 - Meteoroid

This doesn't work as it still has a text input. Am I missing something?

JohnsonRaju
6 - Meteoroid

Hi,

 

Could you help me understand what's actually being done here? Apologies if my question is silly.

 

I tried changing the date but that doesn't seem to change anything in the output. The test data table still comes through even when the control parameter is false.

 

I am trying to see the same how we can enable/disable container dynamically.

 

Thanks!

DavidP
17 - Castor
17 - Castor

Hi @JohnsonRaju 

 

The workflow tests if the date in the date field is a Saturday.

 

If it is a Saturday, a True value is passed to the control parameter of the macro, which means the container is disabled and the output data tool does not execute.

 

If the date is not a Saturday, a False value is passed, which means the container is not disabled and the file is written.

 

You can change the rule that disables or enables the macro by changing the If statement in the formula tool in the workflow.

 

I hope this makes sense.

Labels