Hello everyone!
I'm still learning this complex software and I've encountered a problem.
Since I'm used to create little programs in Python, bash to automate SQL queries and save Data Bases in a close and controlled environment, I'm trying to do the same in Alteryx.
for example:
- Depending on what Week I am (example... Week = 03, Year=2023, Month = 04) I need to download my information from the last week, in this case, Week = 02 same Month and Year.
I want to dynamically change the Query inside "Connect to DB" Tool. since I have something like:

(That is just an example)
Is there any way to automate the change of that specific text in the Where Clausure "20230402" depending on the week that I am?
It might be simple to change every Morning just those numbers and run it, but I want it to escalate it to a bigger workflow where there are multiples downloads.
As well for the output files names.
That, if you downloaded Week 02, the file name will automatically change to XXXX_2023_04_02.yxdb
I've looking on some old post but doesn't quite explain how to do it properly using "Connect to DB" Tool or if there is another option.
Thanks in advance!