Alteryx Designer Desktop Discussions

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

Dynamic: Getting the day Before

neromerob
10 - Fireball

Hello.

I´m trying to find a way to get information from the last day in a database.

Lest say that the database has a field (date_1) with a format like this  ‘220708’ (July 8, 2022) so, I would like to use a formula tool (or something similar) that allows me to get information in this way without the user intervention. 

 

out_put.jpg

Thank You

8 REPLIES 8
binuacs
20 - Arcturus

@neromerob one way of doing this

binuacs_1-1657579207419.png

 

 

AdamSt
7 - Meteor

Hi @neromerob

This workflow will get either the previous day if the current date is not Monday or the last 3 days if it is Monday.

neromerob
10 - Fireball

Hello. @binuacs 

 

First of all thank you for the help.

 

Maybe I didn´t explain myself better and for that I do apologize. 

 

what i need is a formula tool, or something like that  can provide the information from the previous day considering that if i run the workflow on monday, it will return the data from friday, saturday and sunday. For example, If i run the workflow today (12-07-2022) i should get the information for yesterday (11-07-2022)  and if I run the workflow next monday (18-07-2022 ) I should get the info from Friday and the weekend (15,16,17 of July 2022) .

 

Thank you 

Luke_C
17 - Castor

Hi @neromerob 

 

I think @AdamSt 's solution has you covered.

neromerob
10 - Fireball

Hello @AdamSt 

 

Thanks for the help, I try to used the workflow that you gave me but maybe i´m missing something. 

 

here I add a dummy table that looks like this. 

 

data.JPG

 

if i run the workflow today (July 12) i should be getting 112043 rows. 

 

count.jpg

 

Thank you, and my apologize for not providing this data before  

AdamSt
7 - Meteor

Hi @neromerob 

I'm assuming from your example spreadsheet that load_date is what you were calling date_1 in your initial post.  That field is not in YYMMDD format, it has 4 extra digits at the end.  Add a formula tool after your data input stream to create a new variable called date_1 as SUBSTR(TOSTRING([load_date]),0,6).  The rest of the code should then work correctly.

binuacs
20 - Arcturus

@neromerob Sorry I interpreted your question in different way, I updated the filter conditon like below and ran your latest file uploaded. Can you check it is working for you or not?

 

binuacs_1-1657663295385.png

 

 

neromerob
10 - Fireball

thank you so much @binuacs , @AdamSt and @Luke_C  those codes where able to solve the problem, still i have to whait to see what would happen if i run the workflow next monday but i think we are ok. 

 

Labels