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] Traffic LIghts

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Traffic LIghts
 Login/Join
 
Gold member
posted
I have a simple report with 2 columns, i set up a traffic light condition as Column 1 does not equal column2. When this is the case (the row value for Col1 <> row value for col2) i want the font to be red for that column. I cannot find this "column font red" option, i can turn the whole ROW red, but thats not what i want, as future col3 and 4 might be ok... Am i understanding traffic lights correctly? MY end goal is "col1 <> col2" row data....turn font red.

This message has been edited. Last edited by: BSBAL18,


AS Version: 8201
Gen: 10202016
Windows, All Outputs
 
Posts: 49 | Location: St. Louis | Registered: December 13, 2016Report This Post
Platinum Member
posted Hide Post
Which column do you want to be red when col1<>col2?
Can you include your code so we can see how the report is being created. That will determine how you code the style sheet option to do what you want.
It may be easier to include a COMPUTEd field that is 1 or 0 depending on the comparison between your to columns. You can then use this field in the WHEN clause of the style sheet line. You can add a NOPRINT so that it is not displayed in the report.
 
Posts: 140 | Location: Adelaide South Australia | Registered: October 27, 2006Report This Post
Gold member
posted Hide Post
You can see the nearly identical field names. Each "compare" has 3 fields, one is current setting (end in S), one is "should be setting" (end in M) and the last is a compare that has a 1 or null (ends in C) to tell me if that field comparison was = or not =. To your questions, i want BOTH the M and S fields to be red font. You said i could use the C (compare) field to help, and i do have it.

TABLE FILE WFX_SETTINGS_COMPARE
BY WFX_SETTINGS_COMPARE.WFX_SETTINGS_COMPARE.DIV_DESCS
BY WFX_SETTINGS_COMPARE.WFX_SETTINGS_COMPARE.SITE_ALIASS
BY WFX_SETTINGS_COMPARE.WFX_SETTINGS_COMPARE.FLCTR_DESCS
BY WFX_SETTINGS_COMPARE.WFX_SETTINGS_COMPARE.DEFAULT_UNITSS
BY WFX_SETTINGS_COMPARE.WFX_SETTINGS_COMPARE.DEFAULT_UNITSM
BY LOWEST WFX_SETTINGS_COMPARE.WFX_SETTINGS_COMPARE.DEFAULT_UNITSC
BY LOWEST WFX_SETTINGS_COMPARE.WFX_SETTINGS_COMPARE.DRIVE_TIME_MINSS
BY LOWEST WFX_SETTINGS_COMPARE.WFX_SETTINGS_COMPARE.DRIVE_TIME_MINSM
BY LOWEST WFX_SETTINGS_COMPARE.WFX_SETTINGS_COMPARE.DRIVE_TIME_MINSC
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/enwarm.sty,
$
ENDSTYLE
END


AS Version: 8201
Gen: 10202016
Windows, All Outputs
 
Posts: 49 | Location: St. Louis | Registered: December 13, 2016Report This Post
Platinum Member
posted Hide Post
The comparison field should be a COMPUTE not a DEFINE.

It would be really useful to see the DEFINE code and a sample of the actual output.

The stylesheet line will be something like
TYPE=DATA,COLUMN=WFX_SETTINGS_COMPARE.WFX_SETTINGS_COMPARE.DIV_DESCS,COLOR=RED,WHEN=WFX_SETTINGS_COMPARE.WFX_SETTINGS_COMPARE.DRIVE_TIME_MINSC EQ 1,$
 
Posts: 140 | Location: Adelaide South Australia | Registered: October 27, 2006Report This Post
Virtuoso
posted Hide Post
quote:
The comparison field should be a COMPUTE not a DEFINE.

Sorry OPALTOSH, but this is not true. You may need the comparison to be done in a DEFINE. In some cases it could have to be done there.

More detail from BSBAL is needed such has is complete code.

Consider these two samples

-* Sample -1-
-* In this one Italy & W Germany have either SAME or DIFF value in CMP field
TABLE FILE CAR
SUM COMPUTE CMP/A4 = IF BHP NE RPM THEN 'DIFF' ELSE 'SAME';
BY COUNTRY
BY MODEL
BY BHP
BY RPM
END


-* Sample -2-
-* In this one Italy & W Germany only have DIFF value in CMP field
TABLE FILE CAR
SUM COMPUTE CMP/A4 = IF BHP NE RPM THEN 'DIFF' ELSE 'SAME';
BY COUNTRY
END


My point is to show that depending of what your have in your query and what is your expected result, a comparison in a COMPUTE may not always be the proper place.

And if you look at that sample, you will see that W Germany display DIFF as from the COMPUTE and SAME as for the DEFINE. Changing the SUM for a PRINT also change the result. And all this also depend on the BY fields used.
DEFINE FILE CAR
CMP_DEF/A4 = IF BHP NE RPM THEN 'DIFF' ELSE 'SAME';
END
TABLE FILE CAR
SUM COMPUTE CMP/A4 = IF BHP NE RPM THEN 'DIFF' ELSE 'SAME';
    CMP_DEF
BY COUNTRY
END


PRINT display each values once the WHERE clause are applied.
SUM display aggregated values once the WHERE clause are applied.

COMPUTE works with internal matrix data (basically once WHERE clause and SUM are applied), when DEFINE works with source data (before WHERE clause).

This message has been edited. Last edited by: MartinY,


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Platinum Member
posted Hide Post
With respect I am aware of all that having been writing FOCUS code for more than 30 years.
Of course it could require a COMPUTE or a DEFINE but without further information it is impossible to tell.
The main point was that they need a field (however and whenever it is calculated) to be available for use in the Stylesheet's WHEN clause for the column that needs to be styled.

There is just not enough detail from the questioner to be specific about the solution that will work for them.
 
Posts: 140 | Location: Adelaide South Australia | Registered: October 27, 2006Report This Post
Virtuoso
posted Hide Post
quote:
With respect I am aware of all that having been writing FOCUS code for more than 30 years.


Sorry if I've offended you, it was not my intention.

quote:

to be available for use in the Stylesheet's WHEN clause for the column that needs to be styled.


"MACRO" can also be useful to style a row and/or column since it may need less repetitive coded condition.
With WHEN you need to repeat the condition every where, with MACRO you define once.
But both can be use and sometime one is better then the other.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Platinum Member
posted Hide Post
Having a discussion between us is not really helping the questioner.
If he really wants some help he/she needs to show us some more code and explain in more detail what he/she is trying to achieve.
Whether he/she uses MACRO is not really relevant yet. There are always multiple ways of doing this but at this stage we don't really know what they want let alone be in a position to show them how to do it.
 
Posts: 140 | Location: Adelaide South Australia | Registered: October 27, 2006Report 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] Traffic LIghts

Copyright © 1996-2020 Information Builders