community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

How to Exclude rows in output

Asteroid

I can't attach the file, it's too large.

 

This is the output I am expecting. As you can see, it basically includes all of the years after 2013 in the [endingperiod] column. Since years before 2013, if you add 5 to it, it is less than 2018. 

Alteryx
Alteryx

As far as I can tell, it looks correct.  Please let me know what part is not coming out as expected. If you could share an image of your workflow and configuration, that would be useful.

Regards,
Stephen Ruhl
Customer Support Engineer

Highlighted
Meteor

You'll need to treat your years as numbers instead of strings:

 

This formula should work if you use it in a filter tool.  Your TRUE output will be what you discard, and the FALSE output will be what you keep.  I've attached the workflow as well.

tonumber([EndingPeriodOfAvailability],0)+5 < tonumber(left(datetimenow(),4),0)

Capture.PNG

 

To break it down:

 

tonumber([EndingPeriodOfAvailability],0)+5

"Tonumber" converts your ending period value to a integer and adds 5

 

tonumber(left(datetimenow(),4),0)

"datetimenow" returns the current date with year (EX: 2018-06-13), "left" trims the field down to the first 4 characters (which is the year), and "tonumber" converts the year to a numeric field

 

Let me know if this works for you!

 

 

Asteroid

@KHoward: I tried this but it excludes my nulls from the output. I still want where the [endingperiod] is null

Alteryx
Alteryx

Adjust the formula to add Or IsNull():

 

(tonumber([EndingPeriodOfAvailability],0)+5 < tonumber(left(datetimenow(),4),0)) OR IsNull([EndingPeriodOfAvailability])

Regards,
Stephen Ruhl
Customer Support Engineer

Labels