In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Make sure to check your account preferences in my.alteryx to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to filter months (as string two digit) to forward looking months ?

c_raviram
7 - Meteor

Hello expert, I have a field month as string with below values. I want to build a dynamic filter which will only select month greater than equal to current month. (Eg. If I run today, the filter should select month as >=5).

I have build below formula, which works fine,  if month are in single digit and does not work if two digits (like below case). I cannot change the month type to measure. 

 

[Month] > ToString(DateTimeMonth(DateTimeNow())-1)

 

01
02
03
04
05
06
07
08
09
10
11
12

 

2 REPLIES 2
apathetichell
20 - Arcturus

your problem is that 01 is a string - not an integer to so you need to adjust:

 

tonumber([month]) > tonumber(datetimemonth(dattimenow()))-1

 

 

ENix
8 - Asteroid

If your Month field has to be a String you can force the data type to a number for the calculation - ToNumber([Month]) > DateTimeMonth(DateTimeNow())-1

Labels
Top Solution Authors