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.
I am constructing a report consisting of many lines for the advancement unit of a university.
Most of the rows are counts but some are dollars. I need to conditionally format the rows.
In effect if the rownumber is 11 or 21 I need to display $12345 if not then I need to display 12345. I tried using an if then else but had no luck.
The data does contain a row number as I use MORE to concatenate numerous passes through the data, then at the end I am using FML for heavy duty formatting to accommodate the customers needs. The MORES followed by FMl has worked for me before but I am having headaches trying to figure out how to format with dollars when appropriate.
Any hints? I tried computes but no luck i kept getting either if then else error messages or formatting errors. I think that the FML is not a factor as much as my inability to conditionally format the column..
I can post some code if you want but its already up to 800 + rows.This message has been edited. Last edited by: Geoff Fish,
May not be the best way since I don't have you request, but it could be one way.
Since the format is normally applied to a whole column, must twick to have format change on different rows of the same column.
Note that I've "create" data to have it similar to your case.
TABLE FILE CAR
SUM RETAIL_COST NOPRINT
SEATS NOPRINT
COMPUTE ID /I3 = ID + 1;
COMPUTE NVAL /D7 = IF ID EQ 1 THEN RETAIL_COST
ELSE IF ID EQ 3 THEN RETAIL_COST
ELSE IF ID EQ 5 THEN RETAIL_COST ELSE SEATS;
BY COUNTRY
ON TABLE HOLD AS TMP FORMAT FOCUS
END
-RUN
DEFINE FILE TMP
VALX /A9 = FPRINT(NVAL, 'D7', 'A9');
NVALX /A10 = IF ID EQ 1 THEN '$' || VALX
ELSE IF ID EQ 3 THEN '$' || VALX
ELSE IF ID EQ 5 THEN '$' || VALX ELSE VALX;
END
TABLE FILE TMP
SUM NVAL
NVALX
BY ID
BY COUNTRY
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA,
COLUMN=NVALX,
JUSTIFY=RIGHT,
$
ENDSTYLE
END
-RUN
This is just to give you an idea on how to perform the formatting per row.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
DEFINE FILE GGSALES
DYNAMIC_FORMAT/A8 = IF SEQ_NO EQ 1 OR 3 THEN 'I8M' ELSE 'I8C';
END
-*
TABLE FILE GGSALES
PRINT SEQ_NO
DOLLARS/DYNAMIC_FORMAT
IF SEQ_NO LE 4
ON TABLE SET ONLINE-FMT STANDARD
END
I haven't heard of dynamic field formatting not working in any particular release. Not sure what release the feature was introduced. Pretty sure I've been using it since 7.7.something.
I discovered that apparently I cannot dynamically format a compute field directly but if i then print the result i can work magic on that.
so this is my final working solution minus all the previous hold and matches
DEFINE FILE H_ALL DYN_FORM/A8=IF ROWNM EQ 11 OR 21 THEN 'D20.2MBS' ELSE IF ROWNM EQ 2 OR 3 THEN 'D20.2%BS' ELSE 'D20.2BS'; END TABLE FILE H_ALL SUM H_ALL.H_ALL.SUBNAME AS 'Statistic' H_ALL.H_ALL.CY/DYN_FORM AS 'This FY' H_ALL.H_ALL.PY/DYN_FORM AS 'Last FY' COMPUTE VAR1/D20.2 = H_ALL.H_ALL.CY - H_ALL.H_ALL.PY; NOPRINT VAR1/DYN_FORM AS 'Variance' FOR H_ALL.H_ALL.ROWNM NOPRINT