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     2 Primary sort fields

Read-Only Read-Only Topic
Go
Search
Notify
Tools
2 Primary sort fields
 Login/Join
 
Member
posted
Hello,
___________________X X
A________ B________-- --
__________________-- --
__________________-- --
__________________-- --
__________________-- --
__________________-- --
__________________-- --

I would like to be able to sort the values of the same column X by column A and by column B. However, both must be primary sorts, to be able to compare the two resulting X columns.
Is this possible? Or, has anybody needed something like this, and found another way around it?
Thanks!

This message has been edited. Last edited by: Anurupa,
 
Posts: 4 | Registered: January 30, 2007Report This Post
Platinum Member
posted Hide Post
Could you please clarify what you are looking for? I'm not sure I understand what you require. Are there 3 columns -- X, A, and B? Or are A and B values in column X.
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Member
posted Hide Post
I apologize - I hadn't realized that my illustration didn't go through as expected. I've changed it now - hope it makes more sense.
A and B are the 2 sort columns, and there need to be 2 columns of the same field X.
 
Posts: 4 | Registered: January 30, 2007Report This Post
Platinum Member
posted Hide Post
Thanks but still not sure I understand. Would concatenating A and B and sorting on that get you what you need? NOTE:there may be optimizating repercussions to sorting on a DEFINE.
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Member
posted Hide Post
I need A and B to remain separate, and I want to
[1] sort X based on sort field A,
[2] sort X based on sort field B,
and be able to compare columns [1] and [2].
 
Posts: 4 | Registered: January 30, 2007Report This Post
Virtuoso
posted Hide Post
TABLE FILE CAR
PRINT
A
B
X
Y
BY A NOPRINT
BY B NOPRINT
END
A rather basic report, but I think we do not understand what you want.




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
Platinum Member
posted Hide Post
Are A and B the same field but from different tables? This would be the only way what I think you want to do makes sense.

Either way, I think what you want you can get with MATCH FILE. Just know that if field A and field B do not represent a common sort field, the data will get merged with no regard to matching since there is no relationship between A and B.

MATCH FILE tablename
PRINT X
BY A
RUN
FILE tablename
PRINT X
BY B
AFTER MATCH HOLD OLD-OR-NEW
END
TABLE FILE HOLD
PRINT *
END

Look up MATCH and concatenating without a common sort field in the manual for more info.
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
Virtuoso
posted Hide Post
SET ASNAMES=ON

TABLE FILE CAR
PRINT COUNTRY CAR
COMPUTE THELIST/I1=1;
COMPUTE CNTR/I5=LAST CNTR + 1;
BY HIGHEST RCOST AS 'COST'
ON TABLE HOLD AS LISTONE
END

TABLE FILE CAR
PRINT COUNTRY CAR
COMPUTE THELIST/I1=2;
COMPUTE CNTR/I5=LAST CNTR + 1;
BY HIGHEST DCOST AS 'COST'
ON TABLE HOLD AS LISTTWO
END
-RUN

DEFINE FILE LISTONE
LISTNAME/A16=
DECODE THELIST(1 'Retail Cost Sort' 2 'Dealer Cost Sort');
END
DEFINE FILE LISTTWO
LISTNAME/A16=
DECODE THELIST(1 'Retail Cost Sort' 2 'Dealer Cost Sort');
END

TABLE FILE LISTONE
SUM COST COUNTRY CAR
BY CNTR
ACROSS THELIST NOPRINT
ACROSS LISTNAME
MORE
FILE LISTTWO
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Virtuoso
posted Hide Post
I like the MATCH FILE better. I tried to come up with a MATCH FILE example but didn't think it would work if the sorts were different. I was wrong.

Here's an example:

MATCH FILE CAR
PRINT CAR
BY HIGHEST RCOST
RUN
FILE CAR
PRINT CAR
BY HIGHEST DCOST
AFTER MATCH HOLD OLD-OR-NEW
END
TABLE FILE HOLD
PRINT *
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report 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     2 Primary sort fields

Copyright © 1996-2020 Information Builders