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

Scheduled Analytic App with Optional Date Filters Doesn't Work

john_watkins
11 - Bolide

I have an analytic app with two date filters that is used as part of a data load.  The code works fine locally and has logic to run for current month when no dates are passed in.  There is just a start date and end date filter in the calling workflow, and those are then passed to batch macros by sending the variables as control parameters.    

 

-- Local Designer - Runs fine when using "Run" 

-- Local Designer - Runs fine with the "Run as Analytic App" picking NO dates.

-- Local Designer - Runs fine with the "Run as Analytic App" picking non-defaulted dates.

 

-- Gallery - Runs fine when you run it from the gallery manually and use default dates of current_date().

-- Gallery - Runs fine when you run from the gallery manually and pick different non-defaulted dates.

 

-- Scheduler - Will NOT run as there seems to be no variable substitution and all of a sudden the defaulted dates are set to the first day of the next month.  

  Current_date = 3/17/2022

 Scheduler Default Dates = 4/1/2022  (WHY?)

 

 

6 REPLIES 6
mbarone
16 - Nebula
16 - Nebula

Also, are you trying to run a YXWZ on scheduler?  That requires actual input at the time of run.  Or is it a YXMD?  

 

If it's a YXMD, can you include some screenshots (workflow, the data going into the batch macro, the control parameter/action tool within the macro)?  Might help pinpoint what's going on.  

john_watkins
11 - Bolide

The code is a yxwz.   What I attempted to do was code around the cases where the user provided no input.   So if the date controls have no inputs, then assume a normal run and set the dates through a formula.

 

It appears that the scheduler either passes the MM+1/01/YYYY or doesn't even attempt substitutions from the scheduler.  I have been told by Alteryx that I may want to consider and app that runs settings to a config file (or similar process) and then have the load app look there instead of trying to schedule this analytic app and code around the inputs.

mbarone
16 - Nebula
16 - Nebula

Interesting. I've never put a YXWZ on scheduler.  But yes, you could set a config file, but I've always thought of that as a complex workaround to just doing a YXMD and dynamically feeding it what it wants.  I guess I'd have to see the exact use case.  YXWZs are intended for other users to run in the Gallery, where they input whatever parameters the app needs, and it's an on-demand process, not something that gets scheduled.

john_watkins
11 - Bolide

I was trying to accomplish two goals with one piece of code.   The first was to have the normal (happy path) where the data loads daily and refreshes MTD values.  The second was when someone tells me there was an error and shorted me in a file from a few months ago, that I could then open it in the Gallery, change the dates, and the app would refresh the dates I selected (not just MTD).

john_watkins
11 - Bolide

Sometimes you just bang your head enough to get a vision of what is going on.   Under very specific conditions my logic was allowing the variable substitution to REPLACE both strings after the first variable was swapped.  I never thought of the fact that the swaps were not done at once so I changed my start date to what the default end date was in one control and then when I swapped that variable it changed them both.

 

The good news is, it would appear that based on my error handling that i can schedule this as an app to allow normal conditions to run MTD and when opening from the gallery and picking other dates, it will refresh those months using the exact same code base.

 

mbarone
16 - Nebula
16 - Nebula

Glad you solved it!

Labels