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] Problem With Sort Aggregation

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Problem With Sort Aggregation
 Login/Join
 
Member
posted
Hi All,

I was trying to find the best way to go about creating a chart based on a hold file when I ran into a problem that I am sure is my fault, but I am stuck on figuring out the correction. I was going to chart the dealer cost pre inch based upon the CAR length. I started by creating a report that sorted down based upon LENGTH and aggregated the dealer cost associated with that length. But when I ran the report, it was not summing any dealer costs where the identical LENGTHs were not adjacent to one another in the file. One of the problem lengths was the 190 length. One of the 190 records towards the top of the file did not combine with the other two 190 records which were adjacent to one another towards the bottom of the file which did combine. So I had 2 190 records in the report. We found a work around by using a hold file but this seems like it should be unnecessary.

Incorrect Code:
TABLE FILE CAR
SUM 
     CAR.BODY.DEALER_COST
BY  LOWEST CAR.SPECS.LENGTH
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END


Incorrect Report:
LENGTH DEALER_COST
163 2,626
163 5,660
165 4,292
165 2,886
170 5,660
176 11,800
177 4,915
177 25,000
182 4,631
187 5,063
188 14,940
190 7,427
190 16,700
195 21,000
199 11,194

Correct but seemingly ineffiecient code:
TABLE FILE CAR
BY  LOWEST LENGTH
BY  LOWEST DEALER_COST
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS CARTEST FORMAT ALPHA
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END
TABLE FILE CARTEST
SUM
     CARTEST.CARTEST.DEALER_COST
BY  LOWEST CARTEST.CARTEST.LENGTH
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END



Desired Report:
LENGTH DEALER_COST
163 8,286
165 7,178
170 5,660
176 11,800
177 29,915
182 4,631
187 5,063
188 14,940
190 24,127
195 21,000
199 11,194


I am fairly sure I must be doing something wrong, but I am stuck. Thanks in advance for the advice.
John

This message has been edited. Last edited by: John Power,


WebFOCUS 8008
Windows, All Outputs
 
Posts: 14 | Registered: April 10, 2014Report This Post
Virtuoso
posted Hide Post
In car.mas, you'll find

 FIELDNAME=LENGTH,LEN,D5,$                                                      


Since it's a floating-point field, there can be internal values that are unequal but display as the same (integer) value. And it seems there are.

When you hold format alpha, you are effectively rounding the values.
You can do it in one step by using a defined field:

PLENGTH/P5C=LENGTH;

(P5 rather than I5, so that the database value gets rounded rather than truncated)

You can use DEFINE to convert to an integer, and use the defined field
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Member
posted Hide Post
Thanks J! I got it to work just like you described. I also apologize for the late response. I had mistakenly turned off the notifications in the forum.


WebFOCUS 8008
Windows, All Outputs
 
Posts: 14 | Registered: April 10, 2014Report 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] Problem With Sort Aggregation

Copyright © 1996-2020 Information Builders