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     [CLOSED] Very basic column-value based color styling does not work

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Very basic column-value based color styling does not work
 Login/Join
 
Expert
posted
The column-value based color styling does not work in the following example - I do not get colours. v7.7.03 HF4. I don't think my syntax is wrong - am I missing something?

TABLE FILE CAR
SUM
COMPUTE FLG1/A1 = IF SALES LT 8000 THEN '1' ELSE IF SALES GT 8000 THEN '2';
SALES
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=SALES, COLOR=RED, WHEN= FLG1 EQ '1', $
TYPE=DATA, COLUMN=SALES, COLOR=GREEN, WHEN= FLG1 EQ '2', $
END

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
Virtuoso
posted Hide Post
Maybe be a bug - seems to work if I remove the COMPUTE or move the COMPUTE below SALES after the SUM verb.

TABLE FILE CAR
 SUM
  SALES
  COMPUTE FLG1/A1 = IF SALES LT 8000 THEN '1' ELSE IF SALES GT 8000 THEN '2';
 BY COUNTRY
 BY CAR
 BY MODEL
 ON TABLE SET STYLE *
  TYPE=DATA, COLUMN=SALES, COLOR=RED, WHEN=SALES GT 8000, $
  TYPE=DATA, COLUMN=SALES, COLOR=BLUE, WHEN=SALES LT 8000, $
 ENDSTYLE
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
Francis, IF-THEN-ELSE logic, AND, put the COMPUTE after:

  
TABLE FILE CAR
SUM
SALES
COMPUTE FLG1/A1 = IF SALES LE 8000 THEN '1' ELSE '2';

BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=SALES, COLOR=RED, WHEN= FLG1 EQ '1', $
TYPE=DATA, COLUMN=SALES, COLOR=GREEN, WHEN= FLG1 EQ '2', $
END
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
This doesn't work:

TABLE FILE CAR
SUM
COMPUTE COL1/D1 = IF HEIGHT LT 8000 THEN 1 ELSE IF SALES GT HEIGHT THEN 2 ELSE 0;
COMPUTE COL2/D6 = LENGTH * HEIGHT * WIDTH;
SALES
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=SALES, COLOR=GREEN, WHEN= SALES GT 8000, $
TYPE=DATA, COLUMN=SALES, COLOR=RED, WHEN= SALES LT 8000, $
END

This does work:
TABLE FILE CAR
SUM
COMPUTE COL2/D6 = LENGTH * HEIGHT * WIDTH;
SALES
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=SALES, COLOR=GREEN, WHEN= SALES GT 8000, $
TYPE=DATA, COLUMN=SALES, COLOR=RED, WHEN= SALES LT 8000, $
END

SO does this:
TABLE FILE CAR
SUM
SALES
COMPUTE FLG1/A1 = IF SALES LT 8000 THEN '1' ELSE IF SALES GT 8000 THEN '2' ELSE '0';
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=SALES, COLOR=RED, WHEN= FLG1 EQ '1', $
TYPE=DATA, COLUMN=SALES, COLOR=GREEN, WHEN= FLG1 EQ '2', $
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
Virtuoso
posted Hide Post
Mention of SALES in the COMPUTE is the problem. WF must be creating a new SALES column for the compute. This works by identifying the second SALES column for styling:

TABLE FILE CAR
SUM
COMPUTE COL1/D1 = IF HEIGHT LT 8000 THEN 1 ELSE IF SALES GT HEIGHT THEN 2 ELSE 0;
COMPUTE COL2/D6 = LENGTH * HEIGHT * WIDTH;
SALES
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=SALES(2), COLOR=GREEN, WHEN= SALES GT 8000, $
TYPE=DATA, COLUMN=SALES(2), COLOR=RED, WHEN= SALES LT 8000, $
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
Dan, that's it! Thanks.

Like you stated, since SALES is in the internal matrix twice, I should be using SALES(2). I'm putting on my "I should have known that" t-shirt...

Tom, thanks, yes I did try the COMPUTE after, which works.


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
Virtuoso
posted Hide Post
I wear that T-shirt every day.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
The other option is to use relative column numbers like Pn, Bn Cn, etc

TABLE FILE CAR
SUM
COMPUTE FLG1/A1 = IF SALES LT 8000 THEN '1' ELSE IF SALES GT 8000 THEN '2';
SALES
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=P5, COLOR=RED, WHEN= FLG1 EQ '1', $
TYPE=DATA, COLUMN=P5, COLOR=GREEN, WHEN= FLG1 EQ '2', $
END


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
Virtuoso
posted Hide Post
Aha, so invisible fields in the internal matrix have impact on style definitions?!? That explains some curious problems I've had with styling, I wish I'd have known that before.

It makes me wonder though, why is that? That's like handing someone a shotgun with the barrel pointing straight down and not telling them it's loaded and the safety is off. Your report is going to look like your foot: messed up.

We've often switched to using numbered columns (like Waz suggests) after encountering issues like these, but numbered columns have the severe drawback that adding new columns or computations before existing ones (because you need the result in a next computation) breaks your styling - the column numbering changes.
It's even more of a pain with ACROSS-columns, which don't seem like they can be referenced by name at all.


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report 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     [CLOSED] Very basic column-value based color styling does not work

Copyright © 1996-2020 Information Builders