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 need to apply color coding for the following condition, when the country in 'ENGLAND, FRANCE' , I need to apply color only on seats column as, more than 100- green less than 90- red else yellow
TABLE FILE CAR SUM SEATS RETAIL_COST BY MODEL ACROSS COUNTRY
Pls helpThis message has been edited. Last edited by: Kerry,
This Doesnt work,Without the when condition, all the SEATS column across all the value gets colored. when applied a when clause, nothing really happens.
TYPE=DATA, COLUMN=N3 ,BACKCOLOR=GREEN, WHEN=N3 GE 100, $
The first problem you have is that SEATS will never be GE 100, SEATS values only include 2, 4 and 5.
The second problem is that there is a bug with styling ACROSSCOLUMN: you cannot specify the column name - you have to use positional notation, i.e. P1.
Here is a working example:
TABLE FILE CAR
SUM
COMPUTE FLAG1/A1 =
IF NOT COUNTRY IN ('ENGLAND', 'FRANCE') THEN '0' ELSE
IF SEATS GT 4 THEN '1' ELSE
IF SEATS LT 3 THEN '2' ELSE '3'; NOPRINT
SEATS
RETAIL_COST
BY BODYTYPE
ACROSS COUNTRY
ON TABLE SET STYLE *
TYPE=DATA, ACROSSCOLUMN=P1, COLOR=GREEN, WHEN= FLAG1 EQ '1', $
TYPE=DATA, ACROSSCOLUMN=P1, COLOR=RED, WHEN= FLAG1 EQ '2', $
TYPE=DATA, ACROSSCOLUMN=P1, COLOR=BLUE, WHEN= FLAG1 EQ '3', $
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
Beg to differ on the second point works fine in 7.6.6 and 7.6.10
DEFINE FILE CAR COLORIT/A1= IF COUNTRY IN ('ENGLAND','FRANCE') THEN 'Y' ELSE 'N'; END TABLE FILE CAR SUM SEATS RETAIL_COST COLORIT NOPRINT BY BODYTYPE ACROSS COUNTRY ON TABLE SET STYLE * TYPE=DATA, ACROSSCOLUMN=SEATS, BACKCOLOR=GREEN, WHEN= COLORIT EQ 'Y', $ ENDSTYLE END
TABLE FILE CAR
SUM
COMPUTE FLAG1/A1 =
IF NOT COUNTRY IN ('ENGLAND', 'FRANCE') THEN '0' ELSE
IF SEATS GT 4 THEN '1' ELSE
IF SEATS LT 3 THEN '2' ELSE '3'; NOPRINT
SEATS
RETAIL_COST
BY BODYTYPE
ACROSS COUNTRY
ON TABLE SET STYLE *
TYPE=DATA, ACROSSCOLUMN=SEATS, COLOR=GREEN, WHEN= FLAG1 EQ '1', $
TYPE=DATA, ACROSSCOLUMN=SEATS, COLOR=RED, WHEN= FLAG1 EQ '2', $
TYPE=DATA, ACROSSCOLUMN=SEATS, COLOR=BLUE, WHEN= FLAG1 EQ '3', $
ENDSTYLE
END
This does not work in WebFOCUS v7.6.8, Windows XP and AIX.
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
Francis, the problem is with COMPUTE statement. I moved it down, and it works fine in 7.1.6 and 7.6.9
-*Method - 1
TABLE FILE CAR
SUM
SEATS
RETAIL_COST
COMPUTE FLAG1/A1 = IF NOT COUNTRY IN ('ENGLAND', 'FRANCE') THEN '0' ELSE IF SEATS GT 4 THEN '1' ELSE IF SEATS LT 3 THEN '2' ELSE '3';
BY COUNTRY
BY BODYTYPE
ON TABLE HOLD
END
TABLE FILE HOLD
SUM
FLAG1 NOPRINT
SEATS
RETAIL_COST
BY BODYTYPE
ACROSS COUNTRY
ON TABLE SET STYLE *
TYPE=DATA, ACROSSCOLUMN=SEATS, COLOR=GREEN, WHEN= FLAG1 EQ '1', $
TYPE=DATA, ACROSSCOLUMN=SEATS, COLOR=RED, WHEN= FLAG1 EQ '2', $
TYPE=DATA, ACROSSCOLUMN=SEATS, COLOR=BLUE, WHEN= FLAG1 EQ '3', $
ENDSTYLE
END
-*Method - 2
TABLE FILE CAR
SUM
SEATS
RETAIL_COST
COMPUTE FLAG1/A1 = IF NOT COUNTRY IN ('ENGLAND', 'FRANCE') THEN '0' ELSE IF SEATS GT 4 THEN '1' ELSE IF SEATS LT 3 THEN '2' ELSE '3'; NOPRINT
BY BODYTYPE
ACROSS COUNTRY
ON TABLE SET STYLE *
TYPE=DATA, ACROSSCOLUMN=SEATS, COLOR=GREEN, WHEN= FLAG1 EQ '1', $
TYPE=DATA, ACROSSCOLUMN=SEATS, COLOR=RED, WHEN= FLAG1 EQ '2', $
TYPE=DATA, ACROSSCOLUMN=SEATS, COLOR=BLUE, WHEN= FLAG1 EQ '3', $
ENDSTYLE
END
If a StyleSheet uses ACROSSCOLUMN with WHEN and a field name referenced in the WHEN condition appears both under the ACROSS and elsewhere in the report (as is possible with a multi-verb request), the field name under the ACROSS takes precedence. You can refer to the other column using another version of the column notation, such as Cn
The upshot is (although not explicitly stated) that because you use SEATS in the COMPUTE, that is what WebFOCUS finds first in the internal matrix when trying to apply the styling, so the result is that it appears styling is not working. Under those circumstances positional column notation N,C,B needs to be used.
We have a report here listing data by age, where age is divided into 4 categories that need colour-coding in the heading. The number of categories displayed is variable, there's not always data for all four age ranges.
I tried the below, but it doesn't colour-code the across value headings:
DEFINE FILE CAR
COLORIT/A1= IF COUNTRY IN ('ENGLAND','FRANCE') THEN 'Y' ELSE 'N';
END
TABLE FILE CAR
SUM
SEATS
RETAIL_COST
COLORIT NOPRINT
BY BODYTYPE
ACROSS COUNTRY
ON TABLE SET STYLE *
TYPE=ACROSSVALUE, ACROSSCOLUMN=N1, BACKCOLOR=GREEN, WHEN= COLORIT EQ 'Y', $
ENDSTYLE
END
(Using SEATS doesn't work here in 7.6.11 either - we have to use N1)
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 :
COLUMN=Cx seems to work for ACROSSVALUE, but I could only get this to work by establishing which columns to color in advance:
SET HOLDLIST = PRINTONLY
-*
TABLE FILE CAR
SUM
COMPUTE SEQ_NO/I5 = IF (LAST SEQ_NO EQ 0) THEN 1 ELSE (LAST SEQ_NO + 2); NOPRINT
COMPUTE STYLE/A50 = IF COUNTRY IN ('ENGLAND','JAPAN')
THEN 'TYPE=ACROSSVALUE,BACKCOLOR=GREEN,COLUMN=C' || TRIM('L',FPRINT(SEQ_NO,'I5','A5'),5,' ',1,'A5') || ',$'
ELSE 'TYPE=ACROSSVALUE,BACKCOLOR=NONE, COLUMN=C' || TRIM('L',FPRINT(SEQ_NO,'I5','A5'),5,' ',1,'A5') || ',$';
BY COUNTRY NOPRINT
ON TABLE SAVE AS STYLE1
END
-RUN
-*
TABLE FILE CAR
SUM
SEATS
RETAIL_COST
BY BODYTYPE
ACROSS COUNTRY
ON TABLE SET STYLE *
-INCLUDE STYLE1
ENDSTYLE
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007