Free Trial

Alteryx Designer Desktop Discussions

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

How select yesterdays date

shahnawaz_khan
8 - Asteroid

Hi,

 

I have Month till date excel data, how to select yesterdays date every time. Reference data is below.

 

let me know If there is any formula from which I get yesterday's data automatically? 

 

Input   
DatetimeNameCostState
13-11-2024 18:09:09Rohan1213Rajesthan
15-11-2024 14:44:20Anil343Viman
13-11-2024 17:00:53Vasi1223Pune
13-11-2024 13:51:01Shah5656Kharadi
13-11-2024 17:10:37Prash9890Koregaon
13-11-2024 17:16:19Shub45435Camp
13-11-2024 17:24:19Mayu34Nigdi
14-11-2024 17:46:42Nehu434Pune
15-11-2024 09:57:06Anil4645Kharadi
15-11-2024 09:05:10Vasi6536Rajesthan
15-11-2024 09:36:18Shah6764Viman
14-11-2024 14:10:24Prash4563Camp
14-11-2024 13:03:04Prash345Nigdi
14-11-2024 16:53:00Vasi9976Pune

 

 

Output   
DatetimeNameCostState
14-11-2024 14:10:24Prash4563Camp
14-11-2024 13:03:04Prash345Nigdi
14-11-2024 16:53:00Vasi9976Pune
14-11-2024 17:46:42Nehu434Pune

 

5 REPLIES 5
MelGibson
10 - Fireball

date field change.png

 Use this formula to create a new string field - DateTimeFormat(DateTimeAdd(DateTimeParse([Date], "%d-%m-%Y %H:%M:%S"), -1, 'days'), "%d-%m-%Y %H:%M:%S")

I think this will work and you can call your fields whatever you want or you can override the incoming date field. I wanted to show you the progression. 

 

 

 

 

SGolnik
11 - Bolide
11 - Bolide

First you will need to convert you date/time field into the ISO date format. You can either use the DateTime tool or a formula. Then in your filter the formula to find yesterday dynamically would be: DateTimeAdd(DateTimeNow(),-1,'days')

 

https://help.alteryx.com/current/en/designer/functions/datetime-functions.html

nagakavyasri
12 - Quasar
shahnawaz_khan
8 - Asteroid

hi @nagakavyasri,

 

I don't know why but its not working. can you please check.

flying008
15 - Aurora

Hi, @shahnawaz_khan 

 

Custom filter :

 

 

DateTimeFormat(DateTimeParse([Datetime],'%d/%m/%Y %H:%M:%S'),'%Y-%m-%d') = DateTimeFormat(DateTimeAdd(DateTimeToday(), -1,'day'),'%Y-%m-%d')

 

录制_2024_11_16_12_44_39_252.gif

 

Labels
Top Solution Authors