Focal Point
[SOLVED]Sorting MtYY on X axis

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2077023286

May 12, 2016, 05:37 PM
Frank Ronneng
[SOLVED]Sorting MtYY on X axis
Below is an example of a chart that has the HDATE function working and it allows me to sot the months just fine but does not take the year into account.


DEFINE FILE widgets
MONTHYR/I6MtYY = HDATE(COMPLETE_DATE, 'YYMD');
END

GRAPH FILE widgets
SUM WIDGETCOUNTS
BY MANAGER
ACROSS MONTHYR

My data set will be a rolling 12 month so it will cross years.

With this DEFINE the X axis looks like this:

Jan 2016 Feb 2016 March 2016 April 2015 April 2016 May 2015 May 2016 etc.

I need it to recognize the year so that the graph will begin at April 2015 and end with April 2016 then next month will show May 2015 to May 2016 and so on. This will change each month so creating the columns is not an option.

Is there a format where the sort will take the year into account and also be able to display on the X axis as MtYY?

This message has been edited. Last edited by: <Emily McAllister>,


7702, Windows7, html
May 12, 2016, 11:59 PM
Vivian
Did you try
ACROSS LOWEST COMPLETE_DATE NOPRINT
ACROSS MONTHYR


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

May 13, 2016, 09:36 AM
Frank Ronneng
That is the first thing that I tried.... It renders the chart with he Complete_Date data like its ignoring the NOPRINT. It also forces me to change the ON GRAPH SET GRAXIS from 1 to 2 I saw in some other posts that Versions after 8.0 do not allow two chart across fields. I am using APP Studio 8105.


7702, Windows7, html
May 13, 2016, 12:35 PM
Vivian
Well, then what about holding the data sorted in the correct order and then do the graph from that hold file using the one across.

Or... Can you just do a BY COMPLETE_DATE NOPRINT and avoid the double ACROSS?

This message has been edited. Last edited by: Vivian,


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

May 20, 2016, 10:08 AM
Frank Ronneng
I am still unable to resolve this.... The graph sorts the X - axis based on the first ACROSS field even if it is NOPRINT. It ignores the NOPRINT which seems crazy to me. So I can not use a hold file and can not use an extra BY to get the X axis the way the consumer wants it.
I saw a post by Ginny Jakes back in 2007 that touched on the issue of sorting by month number and display month name but I am using WF 8105. So I would think there would be a better way..... And actually I can get the month to sort correct its the year that isn't cooperating...


7702, Windows7, html
May 20, 2016, 10:46 AM
Vivian
What does the Master - metadata - look like for that field? Can you have the usage mmddyy and keep the actual as yymmdd type format?

Hard to solve without looking at it... but hmmm


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

May 22, 2016, 10:13 PM
dbeagan
Try this:
 
DEFINE FILE widgets
MONTHYR/I6MtYY = HDATE(COMPLETE_DATE, 'YYMD');
MONTHYR2/MtYY = MONTHYR;
END

GRAPH FILE widgets
SUM WIDGETCOUNTS
BY MANAGER
ACROSS MONTHYR2 



WebFOCUS 8.2.06
May 23, 2016, 09:47 AM
Frank Ronneng
Hi - This worked just as I need it to. Thank you!! One little thing though - The out put is like this - MAY, 2016. How do I get rid of the comma? I tried with this format: Mt|YY. But then the report gets an error.


7702, Windows7, html