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] Conditional Heading based on report ROW-TOTAL result

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Conditional Heading based on report ROW-TOTAL result
 Login/Join
 
Member
posted
Hi, i want to find a way to have a conditional header based on the result of the grandtotal of my report.
example: if the grandtotal of sales in the report is Greater then 1 000 000$ the conditional text should be "TARGET REACHED, BONUS GRANTED"



TABLE FILE SALES

SUM
PROD1_SALES AS 'PROD1'
PROD2_SALES AS 'PROD2'
PROD3_SALES AS 'PROD3'

BY YEAR

HEADING
"SALES REPORT "

-*------------------------
-*i know it does not work like that but i would like to have something like..

-IF ROW-TOTAL GE 1000000 THEN GOTO BONUS ELSE GOTO NOBONUS
-BONUS
"TARGET REACHED, BONUS GRANTED"
-NOBONUS

-*----------------------------

ON TABLE SET PAGE-NUM OFF
ON TABLE ROW-TOTAL AS 'SALES BY YEAR'
ON TABLE COLUMN-TOTAL AS 'TOTAL SALES'
ON TABLE PCHOLD FORMAT PDF
END

the report ouput should look something like this

SALES REPORT
TARGET REACHED, BONUS GRANTED

YEAR......PROD1...PROD2...PROD3......SALES BY YEAR
2009......10 000...20 000...200 000......230 000
2010......20 000...40 000...300 000......360 000
2011......30 000...60 000...400 000......490 000
TOTAL SALES..60 000...120 000...900 000......1 080 000

Please help.
thanks.

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


7.6.2, windows xp
 
Posts: 3 | Registered: October 20, 2009Report This Post
Gold member
posted Hide Post
Try this

 TABLE FILE SALES
SUM 
PROD1_SALES
PROD2_SALES
PROD3_SALES
COMPUTE GRANDTOT/D19.2=IF YEAR EQ LAST YEAR THEN (PROD1_SALES + PROD2_SALES + PROD3_SALES) ELSE ((PROD1_SALES + PROD2_SALES + PROD3_SALES) + GRANDTOT);
BY YEAR
ON TABLE HOLD AS HOLDSALES
END

TABLE FILE HOLDSALES
PRINT
PROD1_SALES AS 'PROD1'
PROD2_SALES AS 'PROD2'
PROD3_SALES AS 'PROD3'

BY YEAR

HEADING
"SALES REPORT "
HEADING
"TARGET REACHED, BONUS GRANTED"
WHEN SUM.GRANDTOT GE 1000000;

ON TABLE SET PAGE-NUM OFF
ON TABLE ROW-TOTAL AS 'SALES BY YEAR'
ON TABLE COLUMN-TOTAL AS 'TOTAL SALES'
ON TABLE PCHOLD FORMAT PDF
END 


WF: 8201, OS: Windows, Output: HTML, PDF, Excel
 
Posts: 78 | Registered: November 08, 2010Report This Post
Silver Member
posted Hide Post
Try this.. Hope this is what you need...

TABLE FILE CAR
PRINT
DEALER_COST
RETAIL_COST
COMPUTE TOTAL_COST/D12 = DEALER_COST+RETAIL_COST;
BY CAR
ON TABLE COLUMN-TOTAL AS 'TOTAL SALES'
HEADING
"SALES REPORT "
-IF TOT.TOTAL_COST LE 100 THEN GOTO SHOWCOL1 ELSE GOTO SHOWCOL2;
-SHOWCOL1
"COL1"
-SHOWCOL2
"COL2"
END


Release: Webfocus 7.6.11
OS/Platform: Windows
Output: HTML, EXL2K
 
Posts: 32 | Registered: October 29, 2010Report This Post
Member
posted Hide Post
hi guys,
I finaly got this.

CRYMSYN:
tried WHEN SUM.GRANDTOT GE.... but it did not work on HEADING or ON TABLE SUBHEAD. I tested it on subhead/subfoot and it worked fine.

PVPARUC:
i tried the -IF phrase the logic worked great but it did not recognize the TOT.FIELDXXX

so i tried something like this

TABLE FILE HOLD_xxx
SUM
GRANDTOT/I11
ON TABLE NOTOTAL
ON TABLE SAVE
END
-RUN;
-READ SAVE &VAR1.I11.
-RUN;

then I took the &VAR1 and put it into something like

HEADING
"SALES REPORT "
-IF &VAR1 LE 100 THEN GOTO SHOWCOL1 ELSE GOTO SHOWCOL2;
-SHOWCOL1
"COL1"
-SHOWCOL2
"COL2"
END

It finaly works!!!!!
thank you


7.6.2, windows xp
 
Posts: 3 | Registered: October 20, 2009Report This Post
Virtuoso
posted Hide Post
Tiger,

A few comments:

Your solution is ok when the number of records you are reading is not too high. However understand that you are reading your file twice which could create problems of response time.

PVPARUC's solution is a contradiction in terms: he is trying to mix a TABLE request with Dialog Manager. Dialog Manager procedure commands are executed BEFORE the TABLE request, hence there is no way that it can use the TOT.TOTAL_COST field. One should understand that DM is a pre-processor.

This, I think, is a FOCUS solution:
-* File Tiger01.fex
TABLE FILE CAR
SUM SALES NOPRINT
COMPUTE MYHEAD/A35 =IF SALES GT 100000 THEN 'TARGET REACHED, BONUS GRANTED' ELSE 'TARGET NOT REACHED, NO BONUS'; NOPRINT
PRINT SALES
BY COUNTRY
ON TABLE COLUMN-TOTAL
HEADING
"<MYHEAD "
END


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
  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] Conditional Heading based on report ROW-TOTAL result

Copyright © 1996-2020 Information Builders