Alteryx Designer Desktop Discussions

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

Update DateTimeAdd Automatically

knozawa
11 - Bolide

Hello,

 

I would like to update a DateTimeAdd formula automatically.  I am downloading data from social media site and would like to download one week at a time due to the rate limit.  The total download should be 52 times (1 year of data).  Instead of manually changing start date and end date using DateTimeAdd formula, would it be possible to automatically update those date?

 

DateTime Add.png

Thank you,

Kazumi

1 REPLY 1
JoeM
Alteryx Alumni (Retired)

@knozawa, there are a few ways to go about this problem, but I think the simplest solution would be attached.

 

1) I dropped a date time tool to get the current date

2) Use the generate rows tool to create weekly intervals since "today" in the form of end dates

     a) The generate rows is a looping logic, so I initiated a loop with today's date, and the loop would check if it had generated enough records to cover 52 weeks if not, it would make a new record 7 days earlier than the previous record and check again.

3) I use row ID to number the weeks

4) Dropped a formula tool and just subtracted 6 days off the end date to get the period's start date

5) Appended the API HTTP request 

6) Added a formula to plug in the beginning and end date values

 

From here you have an option, you could drop a download tool in and pummel the API, you could use a throttle tool to meter how often each record goes to the download tool, or even build a macro for the request. I hope this helps.

   

 

Labels