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] Across DECODE not working

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Across DECODE not working
 Login/Join
 
Platinum Member
posted
I have Fiscal Year graph with the months on the X-axis, however the months come in as digit; e.g. 1, 2, 3. I need them to come in as months; e.g. Oct, Nov, Dec. I've attempted a DECODE, however it doesn't seem to be working. I've looked through the forum and it appears I have everything in place. Can I get a second set of eyes to see where the error lies (besides behind the keyboard)? Here's the code:
ENGINE INT CACHE SET ON
-INCLUDE IBFS:/WFC/Repository/PFS_KPIs/pfs_getdate_vars.fex
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';


-DEFAULTH &FM = ' '
-READFILE PFSRPTPD
-SET &FM = '&FM.EVAL'


GRAPH FILE PFSAR
-* Created by Info Assist for Graph

COMPUTE PFSAR.PFSAR.FM/A3 = DECODE PFSAR.PFSAR.FM(1 'Oct' 2 'Nov' 3 'Dec' 4 'Jan' 5 'Feb' 6 'Mar' 7 'Apr' 8 'May' 9 'Jun' 10 'Jul' 11 'Aug' 12 'Sep' ELSE 'ERR');
SUM PFSAR.PFSAR.CHARGES
BY PFSAR.PFSAR.ARTYPDESC
ACROSS PFSAR.PFSAR.FM


WHERE PFSAR.PFSAR.CHARGE NE 0
WHERE PFSAR.PFSAR.PSTPDFY EQ &CFY
WHERE PFSAR.PFSAR.FM LE &FM;
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GTREND OFF
ON GRAPH SET AUTOFIT ON
ON GRAPH SET GRAPHSTYLE *

*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setUseSeriesShapes(true);
setReportParsingErrors(false);
setSelectionEnableMove(false);


*END
INCLUDE=IBFS:/WFC/Repository/Branding/endeflt.sty,$
TYPE=REPORT, TITLETEXT='WebFOCUS Report', $
TYPE=HEADING, JUSTIFY=CENTER, FONT='ARIAL', SIZE=9, COLOR=RGB(0 0 0), STYLE=BOLD, $
TYPE=FOOTING, JUSTIFY=LEFT, FONT='ARIAL', SIZE=8, $

*GRAPH_SCRIPT
setMarkerSizeDefault(50);             -*these are the markers on the line graph
setMarkerShape(getSeries(0),2);       -*the ",2" denotes a circle for the marker on the line graph.
setMarkerShape(getSeries(1),2);       -*there is a line for each series.
setMarkerShape(getSeries(2),2);
setMarkerShape(getSeries(3),2);
setMarkerShape(getSeries(4),2);
setMarkerShape(getSeries(5),2);
setLineStyleLegendMarkers(1);         -*sets the size of the legend markers.
setTextRotation(getO1Label(),0);      -*rotates the X axis label to horizontal, not vertical

*END
ENDSTYLE
END
-RUN

-*IA_GRAPH_FINISH

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


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report This Post
Expert
posted Hide Post
GRAPH FILE PFSAR
-* Created by Info Assist for Graph
SUM
COMPUTE PFSAR.PFSAR.FM_NEW/A3 = DECODE PFSAR.PFSAR.FM(1 'Oct' 2 'Nov' 3 'Dec' 4 'Jan' 5 'Feb' 6 'Mar' 7 'Apr' 8 'May' 9 'Jun' 10 'Jul' 11 'Aug' 12 'Sep' ELSE 'ERR'); NOPRINT
PFSAR.PFSAR.CHARGES
BY PFSAR.PFSAR.ARTYPDESC
ACROSS PFSAR.PFSAR.FM NOPRINT
ACROSS TOTAL PFSAR.PFSAR.FM_NEW


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Hey Tom, I tried your suggestion but I get
quote:
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: PFSAR.PFSAR.FM_NEW


I received this same error no matter what name I use in the COMPUTE and ACROSS statements.


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report This Post
Expert
posted Hide Post
I am assumming PFSAR.PFSAR.FM is numeric; if not, need quotes around the values.
Then put it into a DEFINE with a new name:

DEFINE FILE PFSAR
FM_NEW/A3 = DECODE PFSAR.PFSAR.FM(1 'Oct' 2 'Nov' 3 'Dec' 4 'Jan' 5 'Feb' 6 'Mar' 7 'Apr' 8 'May' 9 'Jun' 10 'Jul' 11 'Aug' 12 'Sep' ELSE 'ERR');
END
TABLE FILE PFSAR
SUM
FM_NEW NOPRINT
PFSAR.PFSAR.CHARGES
BY PFSAR.PFSAR.ARTYPDESC
ACROSS PFSAR.PFSAR.FM NOPRINT
ACROSS FM_NEW AS 'Month'

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Yep, the PFSAR.PFSAR.FM is numeric. I went ahead and tried the DEFINE option you suggested anyway, and it works. However, I still have the numeric month value across the bottom and not the alpha month.

If some background helps, my original problem was that my months were in reverse. For this report I only have two months worth of data; Oct and Nov. However, when I use the code below it comes up Nov first and then Oct. I needed to get the months in order.

-DEFAULTH &FM = ' '
-READFILE PFSRPTPD
-SET &FM = '&FM.EVAL'

GRAPH FILE PFSAR
-* Created by Info Assist for Graph
SUM PFSAR.PFSAR.PAYMENTS
   BY PFSAR.PFSAR.ARTYPDESC
ACROSS PFSAR.PFSAR.FYMTH

WHERE PFSAR.PFSAR.CHARGE NE 0
WHERE PFSAR.PFSAR.PSTPDFY GE &CFY
WHERE PFSAR.PFSAR.FM LE &FM;  


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report This Post
Expert
posted Hide Post
Please follow the instructions. I have 2 ACROSS lines, you don't.
ACROSS NUMERIC MONTH NOPRINT
ACROSS ALPHA MONTH AS 'Month'


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Hey Tom,
I managed to get it to work using the original code. Here's what I did:

GRAPH FILE PFSAR
-* Created by Info Assist for Graph

SUM PFSAR.PFSAR.CHARGES
BY PFSAR.PFSAR.ARTYPDESC
ACROSS LOWEST FYMTH AS '' COLUMNS 'Oct' AND 'Nov' AND 'Dec' AND 'Jan' AND 'Feb' AND 'Mar' AND 'Apr' AND 'May' AND 'Jun' AND 'Jul' AND 'Aug' AND 'Sep'
WHERE PFSAR.PFSAR.CHARGE NE 0
WHERE PFSAR.PFSAR.PSTPDFY EQ &CFY
WHERE PFSAR.PFSAR.FM LE &FM;


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report This Post
Expert
posted Hide Post
OK, edit your 1st post and add {Solved}
Many ways to climb the WebFOCUS mountain, very good!

BTW, you should end ALL WHERE statements with a semi-colon. IBI may do code tightening, and, your 1st 2 WHERE statements may break down the road, imho...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
Will do. Thanks again for the advice!


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 116 | Location: Birmingham, Al | Registered: July 23, 2015Report 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] Across DECODE not working

Copyright © 1996-2020 Information Builders