Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Forecast Analysis

Seba
7 - Meteor

I am creating a workflow to compare the actuals of the month versus the forecast. At this point, I generated a formula to identify the "Month Type" for each period. However, the formula is not working for the lines corresponding to the period 01-2024, as these should be labeled as "Pending"

 

Formula.JPGResult.JPG

 

Any ideas?

Thanks and Happy thanksgiving!

3 REPLIES 3
CoG
14 - Magnetar

The issue is that you are working with string fields. I recommend converting to DateTime/Date type for proper comparison. You can use the DateTime Parse Tool twice (for each column) with MM-yyyy to capture the data. Your formula should work after that.

caltang
17 - Castor
17 - Castor

That is happening because you are using a matematical operator on a string, "10-2023" vs "1-2024" will probably just default to true. 

 

Try this:

IF ToString([MonthYear]) = ToString([Current Period])
THEN "Current Month"
ELSEIF DateTimeParse(ToString([MonthYear]),"%m-%Y") < DateTimeParse(ToString([Current Period]),"%m-%Y") 
TEHN "Accum"
ELSE "Pending"
ENDIF

 

Hope this helps. 

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Seba
7 - Meteor

Thanks so much!

Labels
Top Solution Authors