cancel
Showing results for 
Search instead for 
Did you mean: 

Month doesn't appear in the axis for last 12 months

Former Member
0 Kudos
47

Hi !

I have created a graph which gives records for the last twelve months, my formula is:

if {Commande.DATE} >= dateadd('m',-12,currentdate) and {Commande.DATE} <=currentdate then {Commande.DATE}

At this point everything's fine ,

I have to create another formula to have Month name

from today which mean ,the order should be like this on my graph axis, 1st last month is febuary and last 12 months from today is March

March - April - May - June - July - August - September - October - November -December - January Febuary

here is that formula which I have called Month Sort order:

If month({@last12months})=01then

"Janv" else

if month({@last12months})=02 then

"Fév" else

If month({@last12months})=03then

"Mars" else

if month({@last12months})=04 then

"Avril" else

If month({@last12months})=05then

"Mai" else

if month({@last12months})=06 then

"Juin" else

If month({@last12months})=07then

"Juil" else

if month({@last12months})=08 then

"Août" else

If month({@last12months})=09then

"Sept" else

if month({@last12months})=10 then

"Oct" else

If month({@last12months})=11then

"Nov" else

if month({@last12months})=12 then

"Déc" else ""

in the Graph/Chart expert ,in the resulting dialog box I have set the following options:

On Change of: i have set the formula Month Sort order which will bring me the month name and for the order I have set in the Original order .

It works fine I retrieve records for last 12 months but on my axis ,the name for

the last 12 months doesn't appear in this case ( March) it is blank ,I have the records for March but not the month name March in my axis it show april to febuary but not March

Thank you for helping me

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Try to place the formula @last12months in the chart and click on order button and change the grouping for each month . Now you will be able to see the monthly values in the chart. To get the Month names you can use the formula like

monthname(month(@last12months))

Regards,

Raghavendra

Former Member
0 Kudos

Thank you for your reply , but this doesn't solved my problem ,

I'm using a data from SQL2005 which is a stored procedure ,they have created a datefield named "DATE" and group the data the 1st of each month in this SQL stored procedure ,the only day for each month that I have in this data is the first of each month for each record found ,so I've changed the formula for this, to get records the 1st of each month for the last 12 months :

the new Formula for is:

if >= DateAdd("m",-12,CurrentDate) - day(CurrentDate)+1 and <=DateAdd("m",-1,CurrentDate) - day(CurrentDate)+1 then

this condition formula bring me _Null datefield_ ,and this is why I see a null label axis at the bottom,do you have an idea how I can eliminate the null datefield , I need to have only the last 12 months data on this graph but I need all data for the past 3 years for 2 other grah on this same report

Thank you very much ,

Former Member
0 Kudos

Thanks for your help , I've resolved my problem with this :

if {Commande.DATE} >= DateAdd("m",-12,CurrentDate) - day(CurrentDate)+1 and

{Commande.DATE} <=DateAdd("m",-1,CurrentDate) - day(CurrentDate)+1 then {Commande.DATE} else

cdate(0)

this return me 1899-12-30 so I have created another formula to eliminate all records concerned by this date