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] Drill downs in GRANDTOTAL

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Drill downs in GRANDTOTAL
 Login/Join
 
Member
posted
To All,

I have researched the archives and found much interesting information on conditional drill-downs. I could not find answers to some questions about drilling on GRANDTOTAL values.

Example from Car:

TABLE FILE CAR
SUM CNT.STANDARD
ACROSS CAR
BY COUNTRY
WHERE CAR EQ 'AUDI' OR 'DATSUN' OR 'JAGUAR' OR 'JENSEN'
ON TABLE SUMMARIZE
ON TABLE SET STYLE *
TYPE=GRANDTOTAL, COLUMN=N2, WHEN=N2 GT 2,FOCEXEC=dd(carname=CAR),$
TYPE=GRANDTOTAL, COLUMN=N3, WHEN=N3 GT 2,FOCEXEC=dd(carname=CAR),$
TYPE=GRANDTOTAL, COLUMN=N4, WHEN=N4 GT 2,FOCEXEC=dd(carname=CAR),$
TYPE=GRANDTOTAL, COLUMN=N5, WHEN=N5 GT 2,FOCEXEC=dd(carname=CAR),$
END

This creates the following output:
___________________________________________
CAR
AUDI DATSUN JAGUAR JENSEN
COUNTRY
ENGLAND 0 0 5 4
JAPAN 0 2 0 0
W GERMANY 3 0 0 0
TOTAL 3 2 5 4
___________________________________________

(The formatting controls do not show up, but only the number 3 in the TOTAL row is underlined.) Notice that only the Audi column shows an active drill-down. (I suspect the value being used in the WHEN expression is taken from the W GERMANY row and not the TOTAL row.)

Several questions.

1. How can I make the drill down conditional on the value in the TOTAL row?
2. I want to make the drill down active when the TOTAL value is GT 2 and LT 5. How can this be done given that the WHEN statement will not accept AND/OR?
3. Is there a way to do the conditional drill-down in #2 without reference to each column? (In other words, how can I handle the situation in which it is not known how many columns will be returned from the ACROSS action?)

Thanks in advance for the help.

This message has been edited. Last edited by: Dennis Smid,


WebFOCUS 7.6.2
AIX
Output: HTML, AHTML, Excel, and PDF
 
Posts: 18 | Location: Omaha, NE | Registered: November 04, 2007Report This Post
Expert
posted Hide Post
This might work for your first and third points:

TABLE FILE CAR
SUM CNT.STANDARD
ACROSS CAR
BY COUNTRY
WHERE CAR EQ 'AUDI' OR 'DATSUN' OR 'JAGUAR' OR 'JENSEN'
ON TABLE SUMMARIZE
ON TABLE SET STYLE *
TYPE=GRANDTOTAL, ACROSSCOLUMN=CNT.STANDARD, WHEN=N2 GT 2,FOCEXEC=DD(CARNAME=CAR),$
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
Dennis,

Your program has only TWO fields: COUNTRY (N1) and CNT.STANDARD (N2). What happens is that the styling for fields N3, N4 and N5 are ignored.

However, instead of using the N notation, you can use the C notation which identifies the COLUMNS in the output. As follows:
  
TABLE FILE CAR
SUM CNT.STANDARD
ACROSS CAR
BY COUNTRY
WHERE CAR EQ 'AUDI' OR 'DATSUN' OR 'JAGUAR' OR 'JENSEN'
ON TABLE SUMMARIZE
ON TABLE SET STYLE *
TYPE=GRANDTOTAL, COLUMN=C1, WHEN=C1 GT 2,FOCEXEC=dd(carname=CAR),$
TYPE=GRANDTOTAL, COLUMN=C2, WHEN=C2 GT 2,FOCEXEC=dd(carname=CAR),$
TYPE=GRANDTOTAL, COLUMN=C3, WHEN=C3 GT 2,FOCEXEC=dd(carname=CAR),$
TYPE=GRANDTOTAL, COLUMN=C4, WHEN=C4 GT 2,FOCEXEC=dd(carname=CAR),$
END


This should do the trick.


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
Member
posted Hide Post
Danny/Francis,

Both suggestions were helpful. Do either of you have an idea on my second question?

Dennis


WebFOCUS 7.6.2
AIX
Output: HTML, AHTML, Excel, and PDF
 
Posts: 18 | Location: Omaha, NE | Registered: November 04, 2007Report This Post
Expert
posted Hide Post
To do a compound condition, you have to set a flag in a DEFINE or COMPUTE. In your case, you would have to use a COMPUTE at at grand total level so that you can test the value and set the flag. Then you can test the flag as a condition in your stylesheet.


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
Virtuoso
posted Hide Post
Dennis,

This should do the trick:
  
DEFINE FILE CAR
DUM/A1=' ';
END

TABLE FILE CAR
SUM CNT.STANDARD
COMPUTE D/I5=IF CNT.STANDARD GT 2 AND CNT.STANDARD LT 5 THEN 1 ELSE 0; NOPRINT
ACROSS CAR
BY DUM NOPRINT
BY COUNTRY
WHERE CAR EQ 'AUDI' OR 'DATSUN' OR 'JAGUAR' OR 'JENSEN'

ON DUM SUMMARIZE
ON TABLE NOTOTAL
ON TABLE SET STYLE *
TYPE=SUBTOTAL, COLUMN=C1, WHEN=C2 EQ 1,FOCEXEC=dd(carname=CAR),$
TYPE=SUBTOTAL, COLUMN=C3, WHEN=C4 EQ 1,FOCEXEC=dd(carname=CAR),$
TYPE=SUBTOTAL, COLUMN=C5, WHEN=C6 EQ 1,FOCEXEC=dd(carname=CAR),$
TYPE=SUBTOTAL, COLUMN=C7, WHEN=C8 EQ 1,FOCEXEC=dd(carname=CAR),$
END



Or, using the Francis method:
  
TABLE FILE CAR
SUM CNT.STANDARD
COMPUTE D/I5=IF CNT.STANDARD GT 2 AND CNT.STANDARD LT 5 THEN 1 ELSE 0; NOPRINT
ACROSS CAR
BY COUNTRY
WHERE CAR EQ 'AUDI' OR 'DATSUN' OR 'JAGUAR' OR 'JENSEN'
ON TABLE SUMMARIZE
ON TABLE SET STYLE *
TYPE=GRANDTOTAL, ACROSSCOLUMN=CNT.STANDARD, WHEN=N3 EQ 1,FOCEXEC=DD(CARNAME=CAR),$
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
Member
posted Hide Post
Thanks again.

I see how this works for an across report. However, I have not been able to figure out an equivalent approach for a straight table request using a print verb. (I have tried all manners of computes in a multiverb approach, but to no avail.) There must be another trick. See the following example which yields the same result as the matrix given earlier. How can I set the drill-down links in the GRANDTOTAL row to be active for total values greater than 2 and less then 5?

Dennis

TABLE FILE CAR
SUM CNT.STANDARD
ACROSS CAR
BY COUNTRY
WHERE CAR EQ 'AUDI' OR 'DATSUN' OR 'JAGUAR' OR 'JENSEN'
ON TABLE HOLD
END
-*
TABLE FILE HOLD
PRINT E02 AS 'AUDI'
E03 AS 'DATSUN'
E04 AS 'JAGUAR'
E05 AS 'JENSEN'
BY COUNTRY
ON TABLE SUMMARIZE
ON TABLE SET STYLE *
TYPE=GRANDTOTAL, ???????????, FOCEXEC=DD(CARNAME=CAR),$
END


WebFOCUS 7.6.2
AIX
Output: HTML, AHTML, Excel, and PDF
 
Posts: 18 | Location: Omaha, NE | Registered: November 04, 2007Report This Post
Virtuoso
posted Hide Post
Dennis,
Just a slight variation on a previous solution:
  
TABLE FILE HOLD
PRINT 
E02 AS 'AUDI'
COMPUTE D2/I5=IF E02 GT 2 AND E02 LT 5 THEN 1 ELSE 0; NOPRINT
E03 AS 'DATSUN'
COMPUTE D3/I5=IF E03 GT 2 AND E03 LT 5 THEN 1 ELSE 0; NOPRINT 
E04 AS 'JAGUAR'
COMPUTE D4/I5=IF E04 GT 2 AND E04 LT 5 THEN 1 ELSE 0;  NOPRINT
E05 AS 'JENSEN'
COMPUTE D5/I5=IF E05 GT 2 AND E05 LT 5 THEN 1 ELSE 0;  NOPRINT

BY COUNTRY
ON TABLE SUMMARIZE
ON TABLE SET STYLE *
TYPE=GRANDTOTAL, COLUMN=E02, WHEN=D2 EQ 1,FOCEXEC=dd(carname=CAR),$
TYPE=GRANDTOTAL, COLUMN=E03, WHEN=D3 EQ 1,FOCEXEC=dd(carname=CAR),$
TYPE=GRANDTOTAL, COLUMN=E04, WHEN=D4 EQ 1,FOCEXEC=dd(carname=CAR),$
TYPE=GRANDTOTAL, COLUMN=E05, WHEN=D5 EQ 1,FOCEXEC=dd(carname=CAR),$
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
Member
posted Hide Post
Thanks Daniel. That did it. (I forgot that 'summarize' will recalculate the value of a computed variable ... that was the 'trick' I needed.)


WebFOCUS 7.6.2
AIX
Output: HTML, AHTML, Excel, and PDF
 
Posts: 18 | Location: Omaha, NE | Registered: November 04, 2007Report 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] Drill downs in GRANDTOTAL

Copyright © 1996-2020 Information Builders