5 Replies Latest reply on Jul 21, 2017 3:11 PM by mathepac

# Ordering Year, Month in Chart Dates

So I'm ordering my dates ascending with the field "Year ( email sent ) & "/" & Month ( email sent )" and storing as a number (using date was only showing one value). There are counts for each which is working fine.

When I get to my chart it isn't ordering the dates properly. I know that it has to do with what is specified in step one. How do you order dates properly in a chart?

Sorry, I can't send file as it is confidential.

• ###### 1. Re: Ordering Year, Month in Chart Dates

2 digits months become 6 digits number on your calculation, so larger than other 5 digits.

Year ( email sent ) * 100 + Month ( email sent )

or

Year ( email sent ) + Month ( email sent ) / 100

• ###### 2. Re: Ordering Year, Month in Chart Dates

Specify the calculated field Year_Month as "Text" but you'll have to add another step.

** start pseudocode

if Month (email sent)  < 10

then concatMonth = zero & Month (email sent)

else

concatMonth = Month (email sent)

Month_Year = "Year ( email sent ) & concatMonth ( email sent )

** end pseudocode

Storing the result of the calculation "Year ( email sent ) & "/" & Month ( email sent )" as a number will give unpredictable results.

My solution is not the only one or even the most elegant but is easily understood. HTH

• ###### 3. Re: Ordering Year, Month in Chart Dates

Simple but ELEGANT!

It can be a number result and have the same # of digits AND sort correctly numerically and chronologically.

It can be a text result and still SORT correctly (as Text) with alpha & chronologically.

Beverly

• ###### 4. Re: Ordering Year, Month in Chart Dates

Thanks, I love the simplicity of this.

• ###### 5. Re: Ordering Year, Month in Chart Dates

Apologies, I'd forgotten I'd taken the literal  "/" out of the concat and the calculation result can indeed be stored as a number.