Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

If and Statement with Date Range as one condition

ruddikl
5 - Atom

Hi!

 

I'm attempting to write an If statement that is needs to Check the "Posting Date" column for a value that is not the first day of that month (Not the current month) I also need it to ensure a different column has the term "DEM_ACC in it. I think its returning the first of the current month and not the month I need (April) but I cannot figure out how to make it work.

 

Here is what I have so far, but I cant get the date functionality to work for me

 

IF [Posting Date]>DateTimeFirstOfMonth() AND
[Type Code 1]="DEM_ACC"
THEN "1"
ELSE "0"
ENDIF

4 REPLIES 4
mbarone
16 - Nebula
16 - Nebula

IF [Posting Date]>DateTimeTrim([Posting Date],'firstofmonth')

ruddikl
5 - Atom

Thank you so much! So easy, and yet I have been struggling for a few hours!

mbarone
16 - Nebula
16 - Nebula

We've all been there, very welcome!

cmcclellan
13 - Pulsar

Another tip ..... don't use

 

THEN "1"

 

that creates a string field that is (really) a number, instead use

 

THEN 1

 

make sure the datatype is numeric and that makes it easier to add later without the need to change datatypes again 

Labels