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] cannot correctly display calculated field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] cannot correctly display calculated field
 Login/Join
 
Member
posted
Hello all,
I am trying to put together a summary report. I can get all the data to display as needed except for the margin field listed below.

CATEG SUBCAT AMT $
categ1 Subcat1 $$
Subcat2 $$
Total categ1 $$
Margin $$

categ2 subcat1 $$
subcat2 $$
subcat3 $$
total categ2 $$
Margin $$

etc...

-*Margin needs to be a calculated field that will display the following:
(where acctnmbr GE 1 and acctnmbr LE 5 then sum(amt))/(where acctnmbr ge 10 and acctnmbr LE 20 then sum(amt))
(account numbers that make up margin will be different for each section)

With the code I'm using as of now, I don't know how to get this to display. I have case statements that make up the categ and subcat fields. I tried adding case statements for the 'Margin' field but I still cannot get it to display the correct way. There are 6 categories and a few sub categories within each category. The calculated fields that I need to display are related to each categ and subcat (the account numbers that make up the margin calc include the same account numbers that make up each categ and one or two subcats. I've tried creating define fields and using the categ and subcat fields to do the division I need but I need the actual $ amount, not the names of the categ and subcat fields. I also tried then adding a compute to the code below but I get an error about 'recap'.


DEFINE FILE HOLD
SORT/A50 = IF CATEG EQ 'Revenue' THEN '1'
ELSE IF CATEG EQ 'Cost of Sales' THEN '2'
ELSE IF CATEG EQ 'Service COS' THEN '3'
ELSE IF CATEG EQ 'Indirect COS' THEN '4'
ELSE IF CATEG EQ 'General & Administrative' THEN '5'
ELSE IF CATEG EQ 'Other Income/Expense' THEN '6' ELSE '';
END
-******************************************************************************************
-* DISPLAY FINAL REPORT
-******************************************************************************************
TABLE FILE HOLD
SUM AMT
BY SORT NOPRINT
BY CATEG
BY SUBCAT
ON CATEG SUBTOTAL AS 'Total'
WHERE SUBCAT NE ''
END

Any suggestions?

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


7.1.7
Vista
 
Posts: 29 | Registered: July 05, 2007Report This Post
Virtuoso
posted Hide Post
You'll probably need the margin field to be inserted in a subfoot because it is a completely separate calculation. In order to get that value, you'll have to

COMPUTE VAL1/D12.2=IF ACCTNMBR GE 1 AND ACCTNMBR LE 5 THEN AMT ELSE 0; NOPRINT
COMPUTE VAL2/D12.2=IF ACCTNMBR GE 10 AND ACCTNMBR LE 20 THEN AMT ELSE 0;
MARGIN/D6.2=VAL1/VAL2; NOPRINT

Then you can insert the MARGIN field into a subfoot. Seems like this should get what you need - I'm having a little trouble understanding exactly what it is you need. You're referencing account numbers but there is no account number field specified in your code. And you mention category and subcategory a lot but I don't know where they fall into play except as sort fields.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Virtuoso
posted Hide Post
Selena

What you want is typical for a financial report.

Information Builders created therefor the FML functionality.
Take a look at the documentation and see if this works for you.

You can do several calculations , subtract, divisions etc diver per column or let it depend on certain conditions.

Search for FML!




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Member
posted Hide Post
I did some research and FML seems to be exactly what I need. Thanks for all of the responses. I will read up on FML and try coding my report that way.


7.1.7
Vista
 
Posts: 29 | Registered: July 05, 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     [CLOSED] cannot correctly display calculated field

Copyright © 1996-2020 Information Builders