Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Please sort me out: Month formula custom order in Post Reply Post New Topic
Author Message
rawBI
Newbie
Newbie


Joined: 07 Jul 2014
Location: United States
Online Status: Offline
Posts: 2
Quote rawBI Replybullet Topic: Please sort me out: Month formula custom order in
     Posted: 07 Jul 2014 at 9:50am

I would like to sort my @Month formula in a crosstab properly [jfmamjjasond], currently it is sorting the month formula alphabetically i.e. April, August, December, February, ...

monthname(month({Orders.Order Date}))

 

Background stuff:

I wanted to create a crosstab which shows a summary by year and month [see below]. The data is very basic: Order_ID; Order_Date; Order_ Amount

Columns: I have Order_Date group options by year [cool, no problem]
Summary: [all good]
Rows: I have Order_date group options by month [Problem*]
*Problem being that it shows month for every year in data set.
I created @Month to address this

 

Ideal Crosstab:


2000    2001    2002    2003    …

Jan      
Feb
Mar
Apr
May
…

Problem looks like


2000    2001    2002    2003    …

Jan-2000         
Feb-2000
…
Jan-2001         
Feb-2001
…
Jan-2002         
Feb-2002
…

To my formula:
Created @month: monthname(month({Orders.Order Date}))
Put the @month in the rows
Perfect summaries but the months are in alphabetical order
Is there any way to put these months in proper order, i.e. jfmamjjasond

 

So that’s my crosstab dilemma.. which is similar to my chart issue where I want to show a line chart: months in the X-axis; summary data in the Y-axis; different color lines for years. I use the crosstab above to create a chart.

Chart Expert:
Line Chart
On change of @month
Subdivided by Orders.Order_Date
Show [whatever summary]

The chart looks good except the months are alphabetical.

 

Thank you!!! StarStar

 

 

 



 

IP IP Logged
rawBI
Newbie
Newbie


Joined: 07 Jul 2014
Location: United States
Online Status: Offline
Posts: 2
Quote rawBI Replybullet Posted: 07 Jul 2014 at 10:26am
I stumbled across a solution, figured I could share. If there is an easier way to get month grouped, please let me know.

Crosstab expert
Rows
Group Options
Click Drop down for "In specific order" [this step was evading me]
Select months from drop down to set proper order
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum