Alteryx Designer Desktop Discussions

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

Need help converting a Microsoft Access query in Alteryx

kishorhk
6 - Meteoroid

Greetings,

 

I am working on replacing MS Access based functions / queries in Alteryx workflow, trying to replace below month count difference in Filter function in Alteryx, but getting errors, can someone pls help

 

((DateDiff("m",[Incidents].[Creation Date],[Cob].[Rundate])+1)<=6))

 

Basically I want to make sure I am selecting data for Creation Date month <=6. For e.g. if Creation month is Aug, then I need to select records from Incidents table for which the month value is <= 6 than the Creation Date from Incidents table and RunDate from CoB table.

 

Thanks,

kishore Karankal

3 REPLIES 3
ShankerV
17 - Castor

Hi @kishorhk 

 

I assume both the columns are in the same dataset.

Please use the below formula to filter.

 

DateTimeDiff([Creation date],[Rundate],"months")<=6

 

Note: Also the datetimediff function will work only if the dates are in the ISO format which Alteryx recognizes as date YYYY-MM-DD.

If not you need to additionally use datetime tool or datetimeparse function to convert the dates to ISO format.

 

Many thanks

Shanker V

kishorhk
6 - Meteoroid

Thanks Shankar, it helped, may I know how the +1 in month count can be added as well.

ShankerV
17 - Castor

Hi @kishorhk 

 

The below formula will help to add +1 month to Rundate and then use the date for calculating the datetimediff.

 

DateTimeDiff([Creation date], (DateTimeAdd([Rundate],1,"months")),"months") <=6

 

Many thanks

Shanker V

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels