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.
Sorry I realized the formatting got messed up when I posted, here is an image of what I am talking about what it looks like now versus what I would like:
I tried to add in the OVER and it didn't make any difference...here is my code:
SUM CNT.FACT_DAY.FACT_DAY.ACCOUNT_NUMBER AS 'Cases' OVER FACT_DAY.FACT_DAY.DAYS AS 'Days' OVER FACT_DAY.CONSERVABLE_DAY.LOS AS 'Acute LOS' BY LOWEST FACT_DAY.FACT_DAY.SERVICE BY LOWEST FACT_DAY.FACT_DAY.NAME AS 'Employee' ACROSS LOWEST J2.DIM_DATE.FISCAL_MONTH_OF_YEAR_NAME AS '' COLUMNS 'Apr' AND 'May' AND 'Jun' AND 'Jul' AND 'Aug' AND 'Sep' AND 'Oct' AND 'Nov' AND 'Dec' AND 'Jan' AND 'Feb' AND 'Mar' ON TABLE SUBHEAD "" WHERE J2.DIM_DATE.FISCAL_YEAR_NAME EQ '2014/2015';
Except I cannot just do a "BY METRICS" because then they are no longer "summed" or "counted",
For example, if I have a count of employee IDS as one metric, if I put "employee ID" as a BY field, it just lists each of the employee ID as a separate row, but not the actual count of employee in a separate row
-* File hfung01.fex
TABLE FILE CAR
SUM
LENGTH COMPUTE LNAME/A6='LENGTH';
WIDTH COMPUTE WNAME/A6='WIDTH';
HEIGHT COMPUTE HNAME/A6='HEIGHT';
BY CAR
BY MODEL
BY SEATS
ON TABLE HOLD AS HFUNG FORMAT ALPHA
END
!TYPE HFUNG.MAS
-RUN
EX -LINES 9 EDAPUT MASTER,HFUNG,C,MEM
FILENAME=HFUNG , SUFFIX=FIX
SEGMENT=HFUNG, SEGTYPE=S0
FIELDNAME=CAR, ALIAS=E01, USAGE=A16, ACTUAL=A16, $
FIELDNAME=MODEL, ALIAS=E02, USAGE=A24, ACTUAL=A24, $
FIELDNAME=SEATS, ALIAS=E03, USAGE=I3, ACTUAL=A03, $
SEGMENT=METRICS, PARENT=HFUNG, OCCURS=VARIABLE
FIELDNAME=METRIC, ALIAS=E04, USAGE=D5, ACTUAL=A05, $
FIELDNAME=NAME, ALIAS=E05, USAGE=A6, ACTUAL=A06, $
-RUN
DEFINE FILE HFUNG
MONTH/A12=DECODE SEATS (2 APRIL 3 MAY 4 JUNE 5 JULY ELSE DECEMBER);
END
TABLE FILE HFUNG
SUM METRIC
BY CAR
BY MODEL
BY NAME AS ''
ACROSS SEATS NOPRINT
ACROSS MONTH AS ''
ON TABLE SET ACROSSTITLE SIDE
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
The reason I am looking to change this is that right now the columns overlap when I run the report in the composer with each month having 3 metrics, that means I have 12x3 = 36 columns per year which don't fit on a page. Perhaps I can make an expandable column instead of row?This message has been edited. Last edited by: hfung1,
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
-RUN
TABLE FILE CAR
SUM
LENGTH AS METRIC1
WIDTH AS METRIC2
HEIGHT AS METRIC3
BY COUNTRY
BY CAR
BY SEATS
ON TABLE HOLD AS HOLD0
END
-RUN
TABLE FILE HOLD0
SUM
METRIC1 AS METRIC
COMPUTE METRIC_NAME/A8 = 'METRIC 1';
BY COUNTRY
BY CAR
BY SEATS
ON TABLE HOLD AS HOLD1
END
-RUN
TABLE FILE HOLD0
SUM
METRIC2 AS METRIC
COMPUTE METRIC_NAME/A8 = 'METRIC 2';
BY COUNTRY
BY CAR
BY SEATS
ON TABLE HOLD AS HOLD2
END
-RUN
TABLE FILE HOLD0
SUM
METRIC3 AS METRIC
COMPUTE METRIC_NAME/A8 = 'METRIC 3';
BY COUNTRY
BY CAR
BY SEATS
ON TABLE HOLD AS HOLD3
END
-RUN
TABLE FILE HOLD1
SUM
METRIC
BY COUNTRY
BY CAR
BY METRIC_NAME AS ''
ACROSS SEATS
MORE
FILE HOLD2
MORE
FILE HOLD3
END
-RUN
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Thanks Francis! That is perfect with the sample data.
Unfortunately I do not have any experience with HOLD files but I believe I get the gist of it, you are creating a temp table of sorts. Right now I am getting an error:
Can someone help me understand the following two errors I am getting: " IN PROCEDURE new_procedure1 (FOC016) THE TRUNCATED FIELDNAME IS NOT UNIQUE " And "IN PROCEDURE new_procedure1 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HOLD1 BYPASSING TO END OF COMMAND '
My Code is as followed (using Francis's template): TABLE FILE FACT_CONSERVABLE_DAY SUM CNT.FACT_ACCOUNT_NUMBER AS METRIC1 FACT_DAYS AS METRIC2 FACT_LOS AS METRIC3 BY LOWEST FACT_SERVICE AS SERVICE BY LOWEST FACT_NAME AS NAME ACROSS LOWEST J2.DIM_DATE.FISCAL_MONTH_OF_YEAR_NAME AS MONTH AS '' COLUMNS 'Apr' AND 'May' AND 'Jun' AND 'Jul' AND 'Aug' AND 'Sep' AND 'Oct' AND 'Nov' AND 'Dec' AND 'Jan' AND 'Feb' AND 'Mar'
ON TABLE HOLD AS HOLD0 END -RUN
TABLE FILE HOLD0 SUM METRIC1 AS METRIC COMPUTE METRIC_NAME/A8 = 'METRIC 1';
BY SERVICE BY NAME
ON TABLE HOLD AS HOLD1 END
-RUN
TABLE FILE HOLD0 SUM METRIC2 AS METRIC COMPUTE METRIC_NAME/A8 = 'METRIC 2';
BY SERVICE BY NAME
ON TABLE HOLD AS HOLD2 END -RUN
TABLE FILE HOLD0 SUM METRIC3 AS METRIC COMPUTE METRIC_NAME/A8 = 'METRIC 3';
You need SET ASNAMES=ON to ensure the HOLD files will contain column names using the AS instead of the original. This is probably what's causing the (FOC016) THE TRUNCATED FIELDNAME IS NOT UNIQUE error. And this means the HOLD file does not get created, so you get the (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HOLD1 error.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Does this need to be set for each hold file (hold0, hold1, hold2, hold3, etc)?
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
-RUN
TABLE FILE FACT_CONSERVABLE_DAY
SUM
CNT.FACT_CONSERVABLE_DAY.FACT_CONSERVABLE_DAY.ACCOUNT_NUMBER AS METRIC1
FACT_CONSERVABLE_DAY.FACT_CONSERVABLE_DAY.CONSERVABLE_DAYS AS METRIC2
FACT_CONSERVABLE_DAY.FACT_CONSERVABLE_DAY.ACUTE_LOS AS METRIC3
BY LOWEST FACT_CONSERVABLE_DAY.FACT_CONSERVABLE_DAY.PHYSICIAN_SERVICE AS SERVICE
BY LOWEST FACT_CONSERVABLE_DAY.FACT_CONSERVABLE_DAY.PHYSICIAN_NAME AS NAME
ACROSS LOWEST J2.DIM_DATE.FISCAL_MONTH_OF_YEAR_NAME AS MONTH AS '' COLUMNS 'Apr' AND 'May' AND 'Jun' AND 'Jul' AND 'Aug' AND 'Sep' AND 'Oct' AND 'Nov' AND 'Dec' AND 'Jan' AND 'Feb' AND 'Mar'
ON TABLE HOLD AS HOLD0
END
-RUN
TABLE FILE HOLD0
SUM
METRIC1 AS METRIC
COMPUTE METRIC_NAME/A8 = 'METRIC 1';
BY SERVICE
BY NAME
ON TABLE HOLD AS HOLD1
END
-RUN
TABLE FILE HOLD0
SUM
METRIC2 AS METRIC
COMPUTE METRIC_NAME/A8 = 'METRIC 2';
BY SERVICE
BY NAME
ON TABLE HOLD AS HOLD2
END
-RUN
TABLE FILE HOLD0
SUM
METRIC3 AS METRIC
COMPUTE METRIC_NAME/A8 = 'METRIC 3';
BY SERVICE
BY NAME
ON TABLE HOLD AS HOLD3
END
-RUN
TABLE FILE HOLD1
SUM
METRIC
BY SERVICE
BY NAME
BY METRIC_NAME AS ''
ACROSS MONTH
MORE
FILE HOLD2
MORE
FILE HOLD3
END
-RUN
Seeing as you got a FOC016, you probably want to add SET FIELDNAME = NOTRUNC to your profile to disable the shortest unique truncation feature.
In our experience, more often than not, that unique truncation logic will cause your typos to be interpreted as a truncation of some existing field. Since those typos usually are only minor typos, you tend to end up with a field that is very similar to the field you meant, but not necessarily that field (for starters, it will probably have a longer name that only starts the same).
It gets even more dangerous when there are database changes and the field that you were using ceases to exist and now another field which' name starts with the same string gets used.
You might as well tie your foot to a shotgun.
Rather than that, we prefer to get an error during development of such reports that the field we typed does not exist.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
The problems with your last attempt is that you have not mimicked Francis' example in a few ways, and you would need to correct those omissions to get anywhere near the results you want.
Firstly, Francis does not use ACROSS ... AS MONTH within the first hold file.
Secondly, your final report uses MONTH from your interim files but you are not including MONTH within them, so how do you expect to be able to use that column name?
Finally, if the first pass of your data (ON TABLE HOLD AS HOLD0) produces output, then using OVER will give you what you want without having to parse data more than once!
All the potential solutions given will work if you follow their example (Dannys solution is particularly imaginative), but your simplest solution is to use OVER!
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, 2004
OVER, in this context, has nothing to do with FML and I have given you an example of its use above.
Rather than try and fit what the example is doing, just cut and paste the code into a new focexec and run it. It doesn't need any data - that is built for you in the code. The results show with and without OVER.
Once you see the two outputs then you can take a step back and understand what the difference achieves.
TThis message has been edited. Last edited by: Tony A,
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, 2004