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]Highlight a column value based on another column value

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Highlight a column value based on another column value
 Login/Join
 
Gold member
posted
I have an error report and one column value gives the column name of the error for that row. I need to highlight that value.
I created a CAR results for an example. Here I would need the value in BODYTYPE to be highlighted because that is the column with the ERROR. The ERROR column can be any other column, this is just a basic example. Anyone have a way to do this?
 

DEFINE FILE CAR
ERROR/A20='BODYTYPE';
END
TABLE FILE CAR
PRINT 
     ERROR
	 CAR.COMP.CAR
     CAR.CARREC.MODEL
     CAR.BODY.BODYTYPE
     CAR.BODY.SEATS
     CAR.SPECS.LENGTH
     CAR.WARANT.WARRANTY
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/BIRS05/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END

 

This message has been edited. Last edited by: <Emily McAllister>,


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Expert
posted Hide Post
'WHEN' is your friend:

DEFINE FILE CAR
ERROR/A20='BODYTYPE';
END

TABLE FILE CAR
PRINT 
ERROR
CAR.COMP.CAR
CAR.CARREC.MODEL
CAR.BODY.BODYTYPE
CAR.BODY.SEATS
CAR.SPECS.LENGTH
CAR.WARANT.WARRANTY
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=CAR     , COLOR=RED, WHEN=ERROR EQ 'CAR'     , $   
TYPE=DATA, COLUMN=MODEL   , COLOR=RED, WHEN=ERROR EQ 'MODEL'   , $   
TYPE=DATA, COLUMN=BODYTYPE, COLOR=RED, WHEN=ERROR EQ 'BODYTYPE', $
ENDSTYLE
END


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
I second the WHEN. Just discovered it a couple weeks ago as I needed to essentially create a stop light for certain cells based upon comparison values and it works like a charm.

TYPE=TABFOOTING,
LINE=7,
OBJECT=FIELD,
ITEM=5,
COLOR='WHITE',
BACKCOLOR='GREEN',
COLSPAN=1,
JUSTIFY=CENTER,
WHEN=FINAL_NUMBERS.SEG01.PTOVERALL_PCT GE &SLA_OVERALL_SLA,
$
TYPE=TABFOOTING,
LINE=7,
OBJECT=FIELD,
ITEM=5,
BACKCOLOR='YELLOW',
COLSPAN=1,
JUSTIFY=CENTER,
WHEN=FINAL_NUMBERS.SEG01.PTOVERALL_PCT GT &SLA_OVERALL_PRE,
$
TYPE=TABFOOTING,
LINE=7,
OBJECT=FIELD,
ITEM=5,
COLOR='WHITE',
BACKCOLOR='RED',
COLSPAN=1,
JUSTIFY=CENTER,
WHEN=FINAL_NUMBERS.SEG01.PTOVERALL_PCT LE &SLA_OVERALL_PRE,
$


JC
WebFOCUS Dev Studio / App Studio
8.2.01
Windows 7
 
Posts: 146 | Registered: November 09, 2015Report This Post
Gold member
posted Hide Post
Thanks, I have 110 columns to do and that looks like it will work!
How can we do this in the Report Painter?


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Expert
posted Hide Post
Coding is my forte, not pointing and clicking, so I hope someone else can answer your question.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Another question, I can have multiple error columns for a row, but I need to return one unique row with all the error columns highlighted.
For example:
ERROR CAR MODEL BODYTYPE SEATS LENGTH WARRANTY
BODYTYPE JAGUAR V12XKE AUTO CONVERTIBLE 2 190 12 MONTHS OR 12000 MILES
CAR JAGUAR V12XKE AUTO CONVERTIBLE 2 190 12 MONTHS OR 12000 MILES

I want BODYTYPE and CAR to be RED in a single line and would hide the ERROR column so there is only one row.
CAR MODEL BODYTYPE SEATS LENGTH WARRANTY
JAGUAR V12XKE AUTO CONVERTIBLE 2 190 12 MONTHS OR 12000 MILES


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Master
posted Hide Post
quote:
Originally posted by Mikey:
Thanks, I have 110 columns to do and that looks like it will work!
How can we do this in the Report Painter?

Well, after giving it a try, I would say that you can't.

You can create a DEFINE field "ERROR" easily enough in both InfoAssist and App Studio/Report Painter, but after that things get murky real fast...

If you are starting from scratch in InfoAssist, you can right-click on the "CAR" column, then select "More -> Traffic Light Conditions". You can then select the ERROR field and set "Equal to -> CAR". But I don't see how to GUI your way to getting a WHEN statement to generate. So that's useless.

If you are not starting from scratch, and have saved Francis' code in a FEX file, InfoAssist will not open up that FEX file in GUI mode. But App Studio/Report Painter opens up that same FEX file in GUI mode, and changes Francis' code to this:

TABLE FILE CAR
PRINT 
     ERROR
     CAR.COMP.CAR
     CAR.CARREC.MODEL
     CAR.BODY.BODYTYPE
     CAR.BODY.SEATS
     CAR.SPECS.LENGTH
     CAR.WARANT.WARRANTY
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
TYPE=DATA,
     COLUMN=N2,
     COLOR='RED',
     WHEN=N1 EQ 'CAR',
$
TYPE=DATA,
     COLUMN=N3,
     COLOR='RED',
     WHEN=N1 EQ 'MODEL',
$
TYPE=DATA,
     COLUMN=N4,
     COLOR='RED',
     WHEN=N1 EQ 'BODYTYPE',
$
ENDSTYLE
END

In App Studio/Report Painter, you can left-click the CAR column, then click the "Appearance" menu choice at the top and a traffic light icon will appear next to a drop down list. In that list, you can select "Add/Edit Conditions". Interestingly, the FEX code that should be considered traffic light conditions isn't recognized. But you can create new traffic light conditions for the CAR column. After choosing to create a new condition, you can select field ERROR, relation "is equal to" and value "CAR". But that seems to be all that you can do. Again, no WHEN statement option. So that's useless as well.

I'm sure Francis is hard at work today trying to figure this out, so I will defer to him.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Gold member
posted Hide Post
Is there a way to use LIKE in the WHEN?
 
DEFINE FILE CAR
ERROR/A20='|BODYTYPE|CAR|';
END

TABLE FILE CAR
PRINT 
ERROR
CAR.COMP.CAR
CAR.CARREC.MODEL
CAR.BODY.BODYTYPE
CAR.BODY.SEATS
CAR.SPECS.LENGTH
CAR.WARANT.WARRANTY
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=CAR     , COLOR=RED, WHEN=ERROR LIKE '%|CAR|%'     , $   
TYPE=DATA, COLUMN=MODEL   , COLOR=RED, WHEN=ERROR LIKE '%|MODEL|%'   , $   
TYPE=DATA, COLUMN=BODYTYPE, COLOR=RED, WHEN=ERROR LIKE '%|BODYTYPE|%', $
ENDSTYLE
END
 


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Expert
posted Hide Post
WHEN can only use very simple conditions, so I don't think LIKE will work.

The easiest way to do this is to use COMPUTE field NOPRINT to create a 'style flag' and then use it in the WHERE statement:

...
COMPUTE ERROR1_FLAG/A1 = IF ERROR LIKE '%CAR%' THEN 'Y' ELSE 'N'; NOPRINT
...
TYPE=DATA, COLUMN=CAR     , COLOR=RED, WHEN=ERROR1_FLAG EQ 'Y', $
...

This message has been edited. Last edited by: Francis Mariani,


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
I came up with a way to get the column number that has an error and place that in the first column, but now I need 2 title rows. I tried SUBHEAD, but it displays above the report header. Any way to get 2 title rows?

 
DEFINE FILE CAR
Error_Column/I3=IF SEATS EQ 2 THEN 1 
ELSE IF SEATS EQ 4 THEN 3
ELSE 5;
END
TABLE FILE CAR
PRINT 
     Error_Column
	 CAR.COMP.CAR
     CAR.CARREC.MODEL
     CAR.BODY.BODYTYPE
     CAR.BODY.SEATS
     CAR.SPECS.LENGTH
     CAR.WARANT.WARRANTY
HEADING
"Standard Report"
"ABC123 CAR"
"Company XYZ"
ON TABLE SUBHEAD
" <+0>1<+0>2<+0>3<+0>4<+0>5<+0>6"
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL07
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/BIRS05/_EDAHOME/ETC/endeflt.sty,
$
TYPE=TABHEADING,
     HEADALIGN=BODY,
$
ENDSTYLE
END
 


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report This Post
Gold member
posted Hide Post
I got it to work in HEADER with COLSPAN first 3 lines

 
DEFINE FILE CAR
Error_Column/I3=IF SEATS EQ 2 THEN 1 
ELSE IF SEATS EQ 4 THEN 3
ELSE 5;
END
TABLE FILE CAR
PRINT 
     CAR.BODY.Error_Column
     CAR.COMP.CAR
     CAR.CARREC.MODEL
     CAR.BODY.BODYTYPE
     CAR.BODY.SEATS
     CAR.SPECS.LENGTH
     CAR.WARANT.WARRANTY
HEADING
"Standard Report"
"ABC123 CAR"
"Company XYZ"
" <+0>1<+0>2<+0>3<+0>4<+0>5<+0>6"
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XLSX
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/BIRS05/_EDAHOME/ETC/endeflt.sty,
$
TYPE=HEADING,
     HEADALIGN=BODY,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     COLSPAN=7,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=2,
     OBJECT=TEXT,
     ITEM=1,
     COLSPAN=7,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=3,
     OBJECT=TEXT,
     ITEM=1,
     COLSPAN=7,
     JUSTIFY=CENTER,
$
ENDSTYLE
END
 


8007
Windows 7, PDF, Excel
 
Posts: 75 | Registered: September 03, 2013Report 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]Highlight a column value based on another column value

Copyright © 1996-2020 Information Builders