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     Conditional Formatting

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Conditional Formatting
 Login/Join
 
Gold member
posted
I am newbie and I am trying to change color of the values in my column if it meets 2 criteria. I am applying conditional formatting 'WHEN' and I'm getting this error:
(FOC3202) BAD VALUE IN STYLESHEET FILE AT LINE: 15 WHEN=N2 GE '8000' AND N4
EQ 'E'


Here's my code:

TABLE FILE SQLOUT
PRINT
fleetId
equipmentNumber
currentPro
serviceType
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
$
TYPE=DATA,
COLUMN=N2,
BACKCOLOR='AQUA',
WHEN=equipmentNumber GE '8000' AND serviceType EQ 'E',
$
ENDSTYLE
END

I appreciate any help you can give me! Thanks!


Winnie

Webfocus 7.7.3
 
Posts: 83 | Registered: July 16, 2008Report This Post
Expert
posted Hide Post
Winnie,

To do a condition on two variables, you'll have to set up a define that is true or false, 1 or 0, depending on the evaluation of your variables. You can then test that field in your stylesheet.

For example the define would be:

CONDSW/I1=IF EQUIPMENTNUMBER GE '8000' AND SERVICETYPE EQ 'E' THEN 1 ELSE 0;

And your stylesheet would be:

WHEN CONDSW EQ 1,

Hope this helps.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Gold member
posted Hide Post
Thanks, Ginny! I set up a define just as you advised, but it didn't seem to work. The report ran fine, but it's not highlighting the criteria I specified. I even narrowed it to just one criteria using the define, but it still didn't work...


Winnie

Webfocus 7.7.3
 
Posts: 83 | Registered: July 16, 2008Report This Post
Virtuoso
posted Hide Post
I ran into this recently and learned that the conditional criteria must be simple (only one criteria) and not compound - as Ginny states. However, our workaround was the solution she provides and it works fine so there must be something else going on.

There is one additional way to do this and that is by creating a macro condition such as
DEFMACRO=COND0001,
MACTYPE=RULE,
WHEN=CONDSW EQ 1,$

and then

TYPE=DATA,
COLUMN=N2,
BACKCOLOR='AQUA',
MACRO=COND0001,
$

One other issue that you may be having is that not all stylesheet properties are respected when output to Excel. I don't know if BACKCOLOR may be one of them. Have you just tried running as is using HTML and see if it works?


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
Gold member
posted Hide Post
Thanks, Darin. I tried your code and use the HTML output and it didn't work, either...Good news is, instead of using 'EQ' in the WHEN clause, I used "NE" and it worked.

TYPE=DATA,
COLUMN=N1,
BACKCOLOR='BLUE',
WHEN=CONDSW NE 0,
$

Thanks Darin and Ginny! Smiler


Winnie

Webfocus 7.7.3
 
Posts: 83 | Registered: July 16, 2008Report This Post
Virtuoso
posted Hide Post
Hmm! Seems like it would be the same thing - but whatever works would be the correct answer. Glad you got it working!


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
Virtuoso
posted Hide Post
Winnie,
I would use a COMPUTE. If you use a DEFINE, make sure that the defined field is invoked in your TABLE command.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
Thanks, Danny...I actually just tried using the COMPUTE and it works, too.


Winnie

Webfocus 7.7.3
 
Posts: 83 | Registered: July 16, 2008Report This Post
Virtuoso
posted Hide Post
quote:
Hmm! Seems like it would be the same thing


Probable explanation for the difference:

WHEN in stylesheet (like COMPUTE or WHERE TOTAL)applies to the accumulated data (the "internal matrix"). If a data-reduction verb is used (SUM, WRITE) then the accumulated value of CONDSW may be > 1, in which case the "NE 0" condition it triggered, but not the "EQ 1".

For that reason, base the styling on a COMPUTE (as Dan suggests), not a DEFINE.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
<dab448>
posted
quote:
To do a condition on two variables, you'll have to set up a define that is true or false, 1 or 0, depending on the evaluation of your variables. You can then test that field in your stylesheet.


Use a variation of Ginny’s example but make the DEFINE an alphanumeric value instead of numeric. Then the EQ seems to work.

DEFINE FILE CAR
CONDSW/A1=IF COUNTRY GE 'JAPAN' AND CAR EQ 'DATSUN' THEN '1' ELSE '0';
END

BACKCOLOR='AQUA',
WHEN = CONDSW EQ '1',
 
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     Conditional Formatting

Copyright © 1996-2020 Information Builders