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] max value of compute in header

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] max value of compute in header
 Login/Join
 
Gold member
posted
for some reason, I am only getting a maximum value in a compute (created in a previous hold) to display only the first record max value for only the first instance read for an all selection rather than for all the different rows or instances created. How can I get the compute to read in all the different instances and than take in the max value that is there in all. Afterwhich, display that in the header? I was thinking of a counter, but not sure what that would entail for this.

thanks in advance!

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



Production & Development: WebFocus 7.6.4
 
Posts: 50 | Registered: August 20, 2008Report This Post
Expert
posted Hide Post
You may be able to use a multi-verb request, one to calculate the MAX over all value and the other for the normal request. Something like this:

SET ASNAMES=ON
SET HOLDFORMAT=ALPHA
SET HOLDLIST=PRINTONLY

TABLE FILE CAR
SUM MAX.SALES AS 'TMAX_SALES'
SUM MAX.SALES AS 'MAX_SALES'
BY COUNTRY
BY CAR
ON TABLE HOLD AS H001
END

TABLE FILE H001
PRINT MAX_SALES
BY COUNTRY
BY CAR
HEADING
"MAX SALES: <TMAX_SALES"
" "
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
Gold member
posted Hide Post
Okay I see, thanks Francis. So what if I have a compute statement that needs several by statements to sort, all in a previous hold file. So far I created another hold to do this. The code looks something like:

TABLE FILE ALL_LOGS
PRINT
LOGIN_DATE
LOGIN_MONTH
LOGIN_YEAR
LOGIN_DAY
LOG_STATE
SORT_DATE
OS_USERNAME
USERNAME
ALPHA_MONTH
FULL_MONTH
COMPUTE LCOUNTER/I4 = IF USERNAME NE LAST USERNAME THEN 1
ELSE IF LOG_STATE EQ 'ON' THEN (LAST LCOUNTER + 1) ELSE (LAST LCOUNTER - 1);
COMPUTE ALPHA_MONTH/A3 = EDIT(LOGIN_MONTH);
COMPUTE MAXCURUSER/D3=LCOUNTER;
BY USERNAME
BY SORT_DATE NOPRINT
BY LOG_STATE NOPRINT
ON TABLE HOLD AS SORTED_LOGS1
END
-*
-*
TABLE FILE SORTED_LOGS1
SUM MAX.LCOUNTER AS "MAX_LCOUNTER"
SUM MAX.LCOUNTER AS "MAX_MCOUNTER"
BY USERNAME
BY SORT_DATE NOPRINT
BY LOG_STATE NOPRINT
PRINT
LOGIN_DATE
LOGIN_MONTH
LOGIN_YEAR
LOGIN_DAY
LOG_STATE
SORT_DATE
OS_USERNAME
USERNAME
ALPHA_MONTH
FULL_MONTH
BY USERNAME
BY SORT_DATE NOPRINT
BY LOG_STATE NOPRINT
ON TABLE HOLD AS SORTED_LOGS
END
-*
GRAPH FILE SORTED_LOGS
-*
HEADING
"Project Reporting"
"Max Value:-*
SUM
MAX_LCOUNTER AS 'Concurrent Users'
ACROSS LOGIN_DAY COLUMNS 1 AND 2 AND 3 AND 4 AND 5 AND 6 AND 7 AND 8 AND 9 AND 10 AND 11 AND 12 AND 13 AND 14 AND 15 AND 16 AND 17 AND 18 AND 19 AND 20 AND 21 AND 22 AND 23 AND 24 AND 25 AND 26 AND 27 AND 28 AND 29 AND 30 AND 31
-*
ON GRAPH SET LOOKGRAPH LINE
END
-EXIT
-*
-*
The Issue I'm having is that the max_lcounter in the heading is not getting off the correct highest value that the graph is displaying. Any ideas as to why? Also how I could check it and modify it to give me the correct max value for the graph.

Thanks



Production & Development: WebFocus 7.6.4
 
Posts: 50 | Registered: August 20, 2008Report This Post
Virtuoso
posted Hide Post
Please use the < / > code tags when posting code, esp when it contains <'s.

TABLE FILE SORTED_LOGS1
SUM MAX.LCOUNTER AS "MAX_LCOUNTER"   *** Use single quotes here, and SET ASNAMES=ON as shown below.

SUM MAX.LCOUNTER AS "MAX_MCOUNTER"   *** ditto
BY SORT_DATE 

*** drop the PRINT section, Graph needs just one record per date (with max pre-computed).

ON TABLE SET ASNAMES ON  *** 
ON TABLE HOLD AS LOG_SUMMARY
END

GRAPH FILE LOG_SUMMARY
HEADING
"Project Reporting"
"Max Value:<MAX_LCOUNTER"   ***  You need to reference MAX_LCOUNTER here for the global max, and MAX_MCOUNTER later for the daily max.  
                            ***  My recollection is that a tag like this defaults to the SUM value; you may have to code <FST.MAX_LCOUNTER to avoid summation.
SUM
MAX_MCOUNTER AS 'Concurrent Users'   *** use MAX_MCOUNTER here, as noted above
ACROSS LOGIN_DAY
COLUMNS 1 AND 2 AND 3 AND 4 AND 5 AND 6 AND 7 AND 8 AND 9 AND 10 AND 11
AND 12 AND 13 AND 14 AND 15 AND 16 AND 17 AND 18 AND 19 AND 20 AND 21
AND 22 AND 23 AND 24 AND 25 AND 26 AND 27 AND 28 AND 29 AND 30 AND 31
-*
ON GRAPH SET LOOKGRAPH LINE
END
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
Okay j.gross I understand. And thank you both!!



Production & Development: WebFocus 7.6.4
 
Posts: 50 | Registered: August 20, 2008Report 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] max value of compute in header

Copyright © 1996-2020 Information Builders