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)conditional format

Read-Only Read-Only Topic
Go
Search
Notify
Tools
(SOLVED)conditional format
 Login/Join
 
Platinum Member
posted
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,


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
 
Posts: 171 | Registered: April 28, 2008Report This Post
Virtuoso
posted Hide Post
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, 2013Report This Post
Master
posted Hide Post
Yes, TABLE has dynamic formatting.
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  

  Sequence#  Dollar Sales                                                       
  ---------  ------------                                                       
          1       $20,805  
          2        20,748  
          3       $20,376  
          4        20,028  
 
Posts: 822 | Registered: April 23, 2003Report This Post
Virtuoso
posted Hide Post
Hi David,

Is that still true that in some WF releases the dynamic format may not work ?


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, 2013Report This Post
Master
posted Hide Post
My model was run in 8105M.

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.
 
Posts: 822 | Registered: April 23, 2003Report This Post
Expert
posted Hide Post
Neither have I, its always worked.

The times this will not work, is if you you need have text in the field.

Although, FML/FMR/EMR/etc may be the exception


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
Platinum Member
posted Hide Post
so David would DYNAMIC_FORMAT/A8 = IF SEQ_NO EQ 1 OR 3 THEN 'D20.2m' ELSE 'D20.2c';


would this work also or is it just integers?


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
 
Posts: 171 | Registered: April 28, 2008Report This Post
Platinum Member
posted Hide Post
Thanks so much

Even this worked

DYN_FORM/A8=IF ROWNM EQ 11 OR 21 THEN 'I8M' ELSE 'D20.2';


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
 
Posts: 171 | Registered: April 28, 2008Report This Post
Platinum Member
posted Hide Post
final solution

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


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
 
Posts: 171 | Registered: April 28, 2008Report This Post
Master
posted Hide Post
Nice follow up Geoff.

Also nice to see an example of dynamic formatting within the Financial Modeling Language construct.
 
Posts: 822 | Registered: April 23, 2003Report 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)conditional format

Copyright © 1996-2020 Information Builders