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.
How do I sum a column of numbers only if the number is say a negative number? Currently I have the sum of a column working except it is summing all numbers and I only want to sum the negative numbers.
I want to sum the balance
Here is the code I am currently using: TABLE FILE EMAILRECAP SUM 'EMAILRECAP.EMAILREC.balance' BY 'EMAILRECAP.EMAILREC.regionAbrev' AS 'Region Abrev' ACROSS 'EMAILRECAP.EMAILREC.day' AS 'Day' HEADING "CSR RECAP" "&DATEtrMDYY <+0> &TOD " " " ON TABLE SET PAGE-NUM OFF ON TABLE COLUMN-TOTAL AS 'TOTAL'
Thanks for the help in advance. Kelly
Prod: WebFOCUS 8.2.0.4 OS: Windows Outputs: HTML, PDF, Excel, PPT In Focus since 2005
Thanks for the suggestions. I tried the define but I don't know how to get it into the report like I want it.
ET I don't want to filter the data out. I want to show all numbers but have a sum of only the negative numbers. Here is what I would like the data to look like:
TABLE FILE ???? SUM COMPUTE COL1/P13.2C = IF COLA LT 0 THEN COLA ELSE 0; NOPRINT COMPUTE COL2P13.2C = IF COLB LT 0 THEN COLB ELSE 0; NOPRINT COMPUTE COL3/P13.2C = IF COLC LT 0 THEN COLC ELSE 0; NOPRINT COMPUTE COL4/P13.2C = IF COLD LT 0 THEN COLD ELSE 0; NOPRINT BY ???? BY ???? ON SORT_COLUMN RECAP COL_01/P13.2C = IF COL1 LT 0 THEN COL1 ELSE 0; COL_02/P13.2C = IF COL2 LT 0 THEN COL2 ELSE 0; COL_03/P13.2C = IF COL3 LT 0 THEN COL3 ELSE 0; COL_04/P13.2C = IF COL4 LT 0 THEN COL4 ELSE 0; ON SORT_COLUMN SUBFOOT " " "TOTAL for School -SCHOOL : -COL_01-COL_02-COL_03-COL_24-COL_05"
Thanks for the help but I think I probably stated the problem wrong. It worked how I said when I did the were if balance < 0.
How do I create a hold file on a total column? I created the hold file fine but then when I go to create a new report from it the total isn't a field that I can use because it was a formula field when creating the hold. I hope that makes sense.
Then from that total field I'll be able to figure the grand total.
Thanks for all the help.
Prod: WebFOCUS 8.2.0.4 OS: Windows Outputs: HTML, PDF, Excel, PPT In Focus since 2005
See lower case inset in your code. This will give day colum total then do you need the across? You may have to rearrange some sorting to get your hold, but you could do a where total on the first sum then.
quote:
TABLE FILE EMAILRECAP sum 'emailrecap.emailrec.balance' by 'emailrecap.emailrec.day' SUM 'EMAILRECAP.EMAILREC.balance' BY 'EMAILRECAP.EMAILREC.regionAbrev' AS 'Region Abrev' ACROSS 'EMAILRECAP.EMAILREC.day' AS 'Day' HEADING "CSR RECAP" "&DATEtrMDYY <+0> &TOD " " " ON TABLE SET PAGE-NUM OFF ON TABLE COLUMN-TOTAL AS 'TOTAL'
Leah
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004