Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Converting Alpha to Dates for Graphs

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Converting Alpha to Dates for Graphs
 Login/Join
 
<Meghan>
posted
In my data source the dates pull in as Alpha fields. I have two dates that I need for different graphs - Fiscal Quarter and Month. I am able to convert the Month to a date by using HINPUT but this does not work for the Fiscal Quarter. So my workaround was to then reformat the HINPUT output to a quarter display using HDATE. I would like to use BOTH of these fields for the ordinal axis of two separate graphs. Obviously the converted month works just fine but the converted month to quarter does not. Essentially it's capturing each quarter correctly but duplicating it given the 'month' that is behind the data. Thus the ordinal axis of my graph reads like so - Q1-2008, Q1-2008, Q1-2008, Q2-2008, etc... HELP!!!!

This message has been edited. Last edited by: Kerry,
 
Report This Post
Virtuoso
posted Hide Post
Do you have the pdf wf713grapg.pdf (or the version for 7.6)

this is from that document page 213
Time Scale Axis Graphs
A time scale axis uses time to display data. Clustered Bar, Stacked Bar, Line, and Scatter
graphs may use a time scale axis. The following time intervals can be specified in each of
these graph types:
TIME_INTERVAL_UNDEFINED = 0
TIME_INTERVAL_SECONDS = 1
TIME_INTERVAL_MINUTES = 2
TIME_INTERVAL_HOURS = 3
TIME_INTERVAL_DAYS = 4
TIME_INTERVAL_WEEKS = 5
TIME_INTERVAL_MONTHS = 6
TIME_INTERVAL_QUARTERS = 7
TIME_INTERVAL_YEARS = 8
It is often useful to represent data with several intervals. Three intervals can be shown
simultaneously on a time axis scale. The following example shows weeks, months, and
years.
The level intervals must be set in decreasing order -- the level zero interval must be less
than level one, level one must be less than level two. In this example, the following
methods were used to set the level intervals:
setLevelInterval(0, Interval.TIME_INTERVAL_WEEKS);
setLevelInterval(1, Interval.TIME_INTERVAL_MONTHS);
setLevelInterval(2, Interval.TIME_INTERVAL_YEARS);


You can set the time interval to month and quarter and it will probably give you what you want.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
<Meghan>
posted
I read through the documentation and all examples have data explicitly set within the text - how do you select data from your data source? I don't think this is what I'm looking for but then again I am VERY new to WebFOCUS so I could just be missing something. Here's what I read on page 534 of that document:

This property enables or disables use of the time scale axis. If this property is enabled, you
must set the UseSampleData property to false and use the setData() methods to define the
data to be graphed.

Can we put our measure that we want displayed within the parens of setData?
 
Report This Post
Virtuoso
posted Hide Post
Meghan

With this settings you can create a graph based on only one date field.

Suppose your data is something like sales and date.

GRAPH FILE XXX
SUM SALES
ACROSS DATE
....

here comes all the special graph coding
including the timescale settings
END




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
<Meghan>
posted
Frank,

I was able to get the 'setUseTimeScaleAxis(true)' functionality to work but unfortunately then I ran into the fact that everything is by calendar year and quarter and what I need is fiscal year and fiscal quarters.

Any other suggestions? Is there any way to convert Q1-2008 into a real date? That seems to be my only option now.
 
Report This Post
Virtuoso
posted Hide Post
There is a wonderful book called '1001 ways to work with dates'
You should buy it.

I'm sure you can convert the Q1-2008 to a real date, but what is the real date for your Q1?
Maybe use a decode would be an option if it is not a straigth date like 20080101.

Else you can force the sequence to the sequence you need by using the keywords COLUMN




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
Meghan, how are the Fiscal Year and Quarter stored, as in what is the column format and how is the data represented?

Master files can do many amazing thing on reading data and converting the format. Is the source a relations one?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
If your quarter isn't stored in your data (or Defined in the master), you may need to run through the data twice. In the first pass decode the month to the appropriate quarter and sum your data by year by quarter. In the second pass do your graph.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
<Meghan>
posted
The Fiscal Quarter is stored as A7 in the meta-data and displays as Q1-2007 (which in terms of calendar months would be July 2006 - Sept 2006.

I was able to create a define field that switches this to read 2007-1 which will then sort properly if used as the ordinal axis for the graph but it's not how I want customers to see it. I want to sort on 2007-1 but display Q1-2007. I used two BY fields, one with NOPRINT which nests my two sort fields and orders the data correctly.

Next question - how do I get rid of the display for one of the nested fields. My ordinal axis now reads 2007-1:Q1-2007. I've tried reading through all the forums here and I've looked at some of the manuals on this but I'm not finding it. I know it's an API call but I just don't which one. Any ideas?
 
Report This Post
Expert
posted Hide Post
Meghan, perhaps I am off themark here, but have a look at this.

EX -LINES 4 EDAPUT MASTER,qtr_mas,CV,FILE
FILENAME=QTR_MAS, SUFFIX=FIX,$
SEGNAME=QTR_MAS, $
  FIELD=QTR ,ALIAS=  ,A7 ,A80 ,$

EX -LINES 7 EDAPUT FOCTEMP,qtr_mas,CV,FILE
Q1-2007
Q2-2007
Q3-2007
Q4-2007
Q1-2008
Q2-2008

-RUN

FILEDEF QTR_MAS DISK qtr_mas.ftm

-RUN

DEFINE FILE QTR_MAS
 QTR_YY/YY = EDIT( EDIT(QTR,'$$$9999')) ;
 QTR_YYQ/YYQ = QTR_YY ;
 QTR_DATE/YYQ = QTR_YYQ + EDIT( EDIT(QTR,'$9')) -1;
END

GRAPH FILE QTR_MAS
SUM QTR_YY
ACROSS QTR_DATE
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Converting Alpha to Dates for Graphs

Copyright © 1996-2020 Information Builders