Alteryx Designer Desktop Discussions

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

pulling previous month data

chiragpatel_1
8 - Asteroid

hi,

 

I want to bring in previous moths data (December 2022) dynamically, and my data set does have previous months data but my formula which i have used many times dosent seem to work, the date is in the correct format.

 

chiragpatel_1_0-1672835236783.png

format of my data,

 

chiragpatel_1_1-1672835316791.png

many thanks

 

2 REPLIES 2
Felipe_Ribeir0
16 - Nebula

Hi @chiragpatel_1 

 

Try this formula (it means filter when 202212 = 202212 basically)

datetimeformat([kdate], "%Y%m") = DateTimeFormat(DateTimeAdd(DateTimeToday(), -1, "months"), "%Y%m")

 

Felipe_Ribeir0_0-1672835779105.png

 

 

binuacs
20 - Arcturus

@chiragpatel_1 One way of doing this

[kdate] >= toDate(DateTimeTrim(DateTimeAdd(DateTimeToday(),-1,'month'),'firstofmonth') )
AND

[kdate] <=
toDate(DateTimeTrim(DateTimeAdd(DateTimeToday(),-1,'month'),'lastofmonth') )

 

 

binuacs_0-1672837330278.png

 

Labels