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] Need Row Count for conditional formatting

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Need Row Count for conditional formatting
 Login/Join
 
<AM>
posted
I am new to WebFocus and I need to format my report based on ROW Count GT 1, I have tried CNT.DST.SYSTEM_AFFECTED, CNT.SYSTEM_AFFECTED and have search the help files. I am hoping you pro's out here have dealt with this before. *fingers crossed*

I need to have the text be "red" if the row count is greater than 1. Here is my code:

TABLE FILE SQLOUT
PRINT
APPROVAL_STATUS AS 'Approval Status'
RISK_ASSESSMENT AS 'Risk'
PLANNED_START AS 'Planned Start'
PLANNED_END AS 'Planned End'
ORIG_OPERATOR AS 'Original Operator'
INSTALL_GROUP AS 'Install Group'
C_NUMBER AS 'CM Number'
CHANGE_DESCRIPTION AS 'Description'
BY SYSTEM_AFFECTED AS 'System Affected'
HEADING
"Support Team: FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
DEFMACRO=COND0001,
MACTYPE=RULE,
WHEN=N2 EQ 'pending',
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
$

This message has been edited. Last edited by: Kerry,
 
Report This Post
Virtuoso
posted Hide Post
CNT. and DST. are intended to be used with a summary operation like SUM. If they are used with PRINT, the value is always 1. It appears that what you want is to color any rows other than the first occurence FOR EACH SYSTEM_AFFECTED value. Is that correct? What you'll need to do is COMPUTE a counter that resets to 0 after each change of SYSTEM_AFFECTED.

Something like
COMPUTE COUNTER/I9=IF SYSTEM_AFFECTED EQ LAST SYSTEM_AFFECTED THEN COUNTER+1 ELSE 0;

Then you can style it with

TYPE=DATA, COLOR=RED, WHEN=COUNTER NE 0,$


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
<AM>
posted
This works great, but I need the first occurance to be 1 if more than 1 occurance exists. Any idea's?
 
Report This Post
<AM>
posted
Got it, Thanks
 
Report This Post
<AM>
posted
This works well, but what I need is if there is only one occurance 0, if more than 1 first occurance =1 then counter+1. Not sure what function to use? Would I need to use a loop?
 
Report This Post
Expert
posted Hide Post
You need to SUM, ADD or WRITE the subordinate value that you are printing within your sort field before the rest of your code, like this -

TABLE FILE CAR
WRITE CNT.MODEL
   BY COUNTRY
PRINT MODEL
   BY COUNTRY
   BY CAR
ON TABLE SET STYLE *
  TYPE=DATA, COLOR=RED, WHEN=N2 GT 1, $
ENDSTYLE
END

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
<AM>
posted
quote:
IF SYSTEM_AFFECTED EQ LAST SYSTEM_AFFECTED THEN COUNTER+1 ELSE 0


Ok, back from vacation and trying to get this to work once again.

Here is my code, but I still have the problem that if there is only one occurance 0, if more than 1 first occurance =1 then counter+1. Not sure what function to use? Would I need to use a loop?
 
Report This Post
<AM>
posted
OOPS here is the code I have now:

if there is only one occurance 0, if more than 1 first occurance =1 then counter+1. Not sure what function to use? Would I need to use a loop?


DEFINE FILE HLD_SC_CHANGE_TICKETS
COUNTER/I9=;
COUNTER/I9=IF SYSTEM_AFFECTED EQ LAST SYSTEM_AFFECTED THEN COUNTER+1 ELSE 0;
END
TABLE FILE HLD_SC_CHANGE_TICKETS
WRITE COUNTER
PRINT
COUNTER
SYSTEM_AFFECTED AS 'System Affected'
SUPPORTTEAM AS 'Support Team'
APPROVAL_STATUS AS 'Approval Status'
RISK_ASSESSMENT AS 'Risk'
PLANNED_START AS 'Planned Start'
PLANNED_END AS 'Planned End'
ORIG_OPERATOR AS 'Original Operator'
INSTALL_GROUP AS 'Install Group'
C_NUMBER AS 'CM Number'
CHANGE_DESRIPTION AS 'Description'
APPLICATION AS 'Application'
WHERE ( PLANNED_START CONTAINS '&PLANNED_START.(FIND PLANNED_START IN hld_plannedstartrolling3months).PLANNED_START.' ) AND ( SUPPORTTEAM EQ '&SUPPORTTEAM.(FIND SUPPORT_TEAM IN hld_supportteams).SUPPORTTEAM.' );
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
 
Report 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] Need Row Count for conditional formatting

Copyright © 1996-2020 Information Builders