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     [CLOSED] Build a chart with multiple fields as x axis

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Build a chart with multiple fields as x axis
 Login/Join
 
Gold member
posted
I am trying to build a chart using the data below.

Description 3 Month 6 Month 12 Month 24 Month 36 Month 60 Month 84 Month 120 Month 180 Month 360 Month

A 0.03% 0.03% 0.10% 0.88% 0.49% 0.02% 0.00% 0.00% 0.00% 0.00%
B 0.03% 0.17% 0.53% 0.14% 0.00% 0.00% 0.00% 0.00% 0.00% 0.00%
C 0.17% 0.11% -0.10% 0.06% 0.46% 0.56% 0.23% -0.02% -0.50% -0.05%
D -0.39% 0.52% 0.23% 0.36% 0.59% 0.57% 0.47% -0.08% -0.02% 0.00%
E -0.02% 0.02% -0.01% -0.03% -0.05% 0.07% 0.12% 0.19% 0.11% 0.00%
F -0.28% 0.40% 0.24% 0.42% 0.72% 0.50% 0.01% -0.05% -0.03% 0.00%

I can do this in Excel with "3month, 6month, 12month.." as marker on my x axis and "A,B,C,D.." as legend. However when I try to build it in App Studio, it's opposite. I guess probably because "3month","6 month","12month"..etc are columns in my metadata.


My question is what can I do to plot this table by having all the columns as my x axis and "A","B","C"... as my legend/series.

Thanks

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 60 | Registered: March 02, 2015Report This Post
<nick z>
posted
Hi,
If I understand you correctly and try to do this with a CAR file, you are asking for something like:
  
COUNTRY	   SALES	  DEALER_COST	RETAIL_COST
ENGLAND	   12000	  37,853	         45,319
FRANCE	   0	  4,631	         5,610
ITALY	   30200	  41,235	         51,065
JAPAN	   78030	  5,512	         6,478
W GERMANY   88190	  54,563	         64,732


And you want to Graph it so SALES, DEALER_COST and RETAIL COST be your X axis group labels and each COUNTRY as a legend field.

Here is a technique that would accomplish this:

  

FILEDEF FOCM DISK FOCCACHE/FOCMCGYV1.MAS
-RUN
-WRITE FOCM FILENAME=FOCMCGYV1, SUFFIX=FIX
-WRITE FOCM SEGNAME=ONE
-WRITE FOCM FIELD=BLANK,,A1,A1,$
-WRITE FOCM SEGNAME=TWO,PARENT=ONE, POSITION=BLANK, OCCURS=VARIABLE
-WRITE FOCM FIELD=CHAR,,A1,A1,$
-WRITE FOCM FIELD=CTR,ORDER,I4,I4,$
-RUN
FILEDEF FOCM CLEAR
FILEDEF FOCMCGYV1 DISK FOCCACHE/FOCMCGYV1.DAT (LRECL 3 RECFM F
-RUN
-WRITE FOCMCGYV1 X
-RUN

JOIN X WITH COUNTRY IN CAR TO BLANK IN FOCMCGYV1 AS J1.
DEFINE FILE CAR
X/A1 WITH COUNTRY= 'X';
VALUES/D12.2 = IF CTR EQ 1 THEN SALES ELSE
                          IF CTR EQ 2 THEN DEALER_COST ELSE
                          IF CTR EQ 3 THEN RETAIL_COST ELSE (-1);
GROUPS/A11 = DECODE CTR(
  1 'SALES'
  2 'DEALER_COST'
  3 'RETAIL_COST'
 ELSE ' ');
END
GRAPH FILE CAR
SUM VALUES 
BY COUNTRY
ACROSS GROUPS AS ' '
WHERE VALUES NE -1
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET ARGRAPHENGIN JSCHART
ON GRAPH SET EMBEDHEADING ON
ON GRAPH SET VZERO OFF
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 

*END
ENDSTYLE
END


Thanks.
Nick.

This message has been edited. Last edited by: <nick z>,
 
Report This Post
Gold member
posted Hide Post
Actually I am not using the original CAR file. Using the CAR file as example, I summarized Sales, Dealer_Cost,Retail_Cost by County first to get the table like the one at the beginning of your message. Then I want to plot them where 'Sales','Dealer_Cost','Retail_Cost' as my X-axis and County as legend field.

Thanks


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 60 | Registered: March 02, 2015Report This Post
<nick z>
posted
Did you try running my code example?
Just copy the entire code into a text editor and run it.
 
Report This Post
Gold member
posted Hide Post
It works with CAR file. However when I try to use my file, it says it could not find the field "MV_KR3M". This is the field that I define at the beginning of the fex. Below is my entire .FEX. Thanks

DEFINE FILE FINANCIAL_MODELING_PORTAL
MV_KR3M/D12.2=MV* KRD03M;
MV_KR6M/D12.2=MV* KRD06M;
MV_KR1Y/D12.2=MV* KRD01Y;
MV_KR2Y/D12.2=MV* KRD02Y;
MV_KR3Y/D12.2=MV* KRD03Y;
MV_KR5Y/D12.2=MV* KRD05Y;
MV_KR7Y/D12.2=MV* KRD07Y;
MV_KR10Y/D12.2=MV* KRD10Y;
MV_KR15Y/D12.2=MV* KRD15Y;
MV_KR30Y/D12.2=MV* KRD30Y;
END
FILEDEF FOCM DISK FOCCACHE/FOCMCGYV1.MAS
-RUN
-WRITE FOCM FILENAME=FOCMCGYV1, SUFFIX=FIX
-WRITE FOCM SEGNAME=ONE
-WRITE FOCM FIELD=BLANK,,A1,A1,$
-WRITE FOCM SEGNAME=TWO,PARENT=ONE, POSITION=BLANK, OCCURS=VARIABLE
-WRITE FOCM FIELD=CHAR,,A1,A1,$
-WRITE FOCM FIELD=CTR,ORDER,I4,I4,$
-RUN
FILEDEF FOCM CLEAR
FILEDEF FOCMCGYV1 DISK FOCCACHE/FOCMCGYV1.DAT (LRECL 3 RECFM F
-RUN
-WRITE FOCMCGYV1 X
-RUN

JOIN X WITH FINANCIAL_MODELING_PORTAL.ZMHDMONTHLY.PORTFOLIO IN FINANCIAL_MODELING_PORTAL TO BLANK IN FOCMCGYV1 AS J1.
DEFINE FILE FINANCIAL_MODELING_PORTAL
X/A1 WITH FINANCIAL_MODELING_PORTAL.ZMHDMONTHLY.PORTFOLIO= 'X';
VALUES/D12.2 = IF CTR EQ 1 THEN MV_KR3M ELSE
IF CTR EQ 2 THEN MV_KR6M ELSE
IF CTR EQ 3 THEN MV_KR1Y ELSE
IF CTR EQ 4 THEN MV_KR2Y ELSE
IF CTR EQ 5 THEN MV_KR3Y ELSE
IF CTR EQ 6 THEN MV_KR5Y ELSE
IF CTR EQ 7 THEN MV_KR7Y ELSE
IF CTR EQ 8 THEN MV_KR10Y ELSE
IF CTR EQ 9 THEN MV_KR15Y ELSE
IF CTR EQ 10 THEN MV_KR30Y ELSE (-1);
GROUPS/A11 = DECODE CTR(
1 'MV_KR3M'
2 'MV_KR6M'
3 'MV_KR1Y'
4 'MV_KR2Y'
5 'MV_KR3Y'
6 'MV_KR5Y'
7 'MV_KR7Y'
8 'MV_KR10Y'
9 'MV_KR15Y'
10 'MV_KR30Y'
ELSE ' ');
END
GRAPH FILE FINANCIAL_MODELING_PORTAL
SUM VALUES
BY FINANCIAL_MODELING_PORTAL.ZMHDMONTHLY.PORTFOLIO
ACROSS GROUPS AS ' '
WHERE VALUES NE -1
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET ARGRAPHENGIN JSCHART
ON GRAPH SET EMBEDHEADING ON
ON GRAPH SET VZERO OFF
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT

setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);

*END
ENDSTYLE
END


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 60 | Registered: March 02, 2015Report This Post
<nick z>
posted
Please open a case with customer support.
They will help you out with syntax errors.
Thanks.
Nick.
 
Report This Post
Expert
posted Hide Post
Because your 2nd DEFINE FILE overrides/eliminates the 1st DEFINE FILE???
Either move your Defines from the 1st down to the 2nd or on the 2nd, do DEFINE FILE FINANCIAL_MODELING_PORTAL ADD


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Gold member
posted Hide Post
Since I am new to WebFocus, this question might be silly. Where can I find the FOCMCGYV1.mas? It looks like this was under FOCCACHE but I can't find it.

Thanks


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 60 | Registered: March 02, 2015Report This Post
Expert
posted Hide Post
From your code sample, the FOCMCGYV1 synonym should be within the FOCCACHE folder for your session. This will be in a subfolder under the edatemp folder.

To locate what the FOCCACHE folder is named for your session you will need to capture the path within code. Search the forum for "FOCCACHE location" to find a method of doing this.

Just be aware that the LRECL, of the method suggested by Nick, dictates the number of rows within the FOCMCGYV1 file.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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     [CLOSED] Build a chart with multiple fields as x axis

Copyright © 1996-2020 Information Builders