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]SUM is for ?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]SUM is for ?
 Login/Join
 
Member
posted
Hi,

I just new to WF have a question about SUM command.

According to the manual, SUM is to add the value, but for below procedure, SUM command only add the SALARY column and did not add the MAX.SALARY or MIN.SALARY

Question is that: you may say that MAX/MIN prefix overwrite the SUM command, I want to know what is the process order and know how to differ the SUM command real meaning?

TABLE FILE EMPLOYEE
SUM
SALARY
MAX.SALARY
MIN.SALARY
BY DEPARTMENT
END

The result is :
PAGE 1
DEPARTMENT-SALARY------MAX SALARY-MIN SALARY
MIS________$160,177.00_$27,062.00_$8,650.00
PRODUCTION_$172,752.00_$29,700.00_$9,050.00

Thanks.

UPDATE:
Thanks for the reply. I know here SUM would aggregate facts with pure columns or columns with prefix operator. This is like SUM COMMAND indicates it is going to do something with the numbers and then check the prefix for further action.

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


WebFOCUS 7.7.03, Windows 7 64bit, IE8
 
Posts: 3 | Registered: August 15, 2012Report This Post
Master
posted Hide Post
Sum is a Verb indeed.

But is just says to WF : "You have to do something with all the rows you get belonging to the BY's'.

And if you don't specify... WF will SUM the values.

You could see it as 'CALCULATE'. That would make it clearer for you:

TABLE FILE EMPLOYEE
CALCULATE SUM.SALARY
          MAX.SALARY
          MIN.SALARY
BY DEPARTMENT
END



Btw. SUM doesn't refer to multiple column in the first place. It refers to the ROWS.



Oh... you might want to do a course... ..or 2.


G'luck


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Virtuoso
posted Hide Post
There is no mystery behind MAX/MIN. These are Prefix operators and do what they say on the tin. The documentation for the MAX/MIN prefix operators is clear:

The prefixes MAX. and MIN. produce the maximum and minimum values, respectively, within a sort group. If the request does not include a sort phrase, MAX. and MIN. produce the maximum and minimum values for the entire report.

There are 17 prefix operators to consider.

If you are new to WebFOCUS, then you should undertake some training courses where the trainer will offer any explanation you require.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
Think of SUM as meaning "summarize": collapse values from multiple in-coming rows into a single figure -- as opposed to PRINT or LIST which will produce one line of output per row of input.

There are several ways to summarize the rows, and the prefix operator can be used to specify which one -- produce an arithmetic sum (SUM., the default); count instances (.CNT); maximum value (.MAX), etc.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Master
posted Hide Post
@j.gross true.

But I must say when English isn't your first language 'summarize' sounds a lot like 'the sum of...' ;-)


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Expert
posted Hide Post
I know that you've closed this topic, but the following might help in understanding the prefix operators a little more for others if not for you.

DEFINE FILE CAR
  RCOST_TOT/D12 = RCOST;
END
TABLE FILE CAR
  SUM RCOST_TOT        AS 'Summation'
      MAX.RCOST_TOT    AS 'Maximum'
      MIN.RCOST_TOT    AS 'Minimum'
      CNT.RCOST_TOT    AS 'Count'
   BY COUNTRY          AS 'Country'
 LIST RCOST            AS 'Values'
   BY COUNTRY          AS 'Country'
   BY RCOST_TOT NOPRINT
WHERE COUNTRY NE 'FRANCE'
ON COUNTRY SUBTOTAL RCOST AS 'Total'
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
  grid=on, size=12, $
  type=data, column=RCOST_TOT, color=blue, $
  type=data, column=MAX.RCOST_TOT, color=green, $
  type=data, column=MIN.RCOST_TOT, color=red, $
  type=data, column=RCOST, color=silver, $
  type=data, column=RCOST, color=green, when=RCOST EQ MAX.RCOST_TOT, $
  type=data, column=RCOST, color=red, when=RCOST EQ MIN.RCOST_TOT, $
  type=data, column=LIST, color=silver, $
  type=subtotal, color=silver, $
  type=subtotal, column=RCOST, color=blue, $
ENDSTYLE
END

The output is more important than the actual code.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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]SUM is for ?

Copyright © 1996-2020 Information Builders