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     Compare sets of numbers

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Compare sets of numbers
 Login/Join
 
Member
posted
Hi,

I have two sets of numbers

Name Number1 Number2
John 1 5
Sam 2 5
Sally 5 7

I have another set of numbers

Dept Number1 Number2
A 2 9
B 1 5

I need a report that will count for me the number of matches between the two by Dept.

The result report would be

Dept John Sam Sally Total
A 0 1 0 1
B 2 1 1 4
Tot 2 2 1 5

Any help is greatly appreciated.

Thanks,

Zippo
 
Posts: 12 | Location: New Yawk | Registered: February 16, 2006Report This Post
Virtuoso
posted Hide Post
Other than the numbers, do the file they are in have any key in common. Where is the data originating - probably first question.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
both sets of data can be written as flat files like

2 A
9 A
1 B
5 B

and

1 John
5 John
2 Sam
5 Sam
5 Sally
7 Sally

if this are the original datasets (with masters) you can join the numbers and do a count by dept and across name with totals to get the result.

But as Leah said, what are the basics....




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
Thank you for the reply.

The files do not have any key in common. In the first file the key is NAME. In the second file the key is DEPT.

The data is in MS-Access.

I was thinking along the lines of FrankDutch and started to play with getting the data into a HOLD file that looks like this;

1 John
5 John

But didn't figure a way to do it. Tried OVER but that didn't work. I think if I know this much I am home free.

Zippo
 
Posts: 12 | Location: New Yawk | Registered: February 16, 2006Report This Post
Virtuoso
posted Hide Post
This may be off some help, but if you have many number columns it will get messy and McGyver could be a better choice.
-* Create sample mfds and data
FILEDEF MASTER DISK test446.mas
-RUN

-WRITE MASTER FILENAME=TEST446, SUFFIX=FIX
-WRITE MASTER SEGNAME=TEST446
-WRITE MASTER FIELDNAME=NAME, FORMAT=A06, ACTUAL=A06, $
-WRITE MASTER FIELDNAME=NUM1, FORMAT=I02, ACTUAL=A01, $
-WRITE MASTER FIELDNAME=NUM2, FORMAT=I02, ACTUAL=A01, $
-RUN
FILEDEF MASTER DISK test447.mas
-RUN

-WRITE MASTER FILENAME=TEST447, SUFFIX=FIX
-WRITE MASTER SEGNAME=TEST447
-WRITE MASTER FIELDNAME=DEPT,       FORMAT=A01, ACTUAL=A01, $
-WRITE MASTER FIELDNAME=NUM1, FORMAT=I02, ACTUAL=A01, $
-WRITE MASTER FIELDNAME=NUM2, FORMAT=I02, ACTUAL=A01, $
-RUN

FILEDEF TEST446 DISK TEST446.TXT
-RUN

-WRITE TEST446 John  15
-WRITE TEST446 Sam   25
-WRITE TEST446 Sally 57

FILEDEF TEST447 DISK TEST447.TXT
-RUN

-WRITE TEST447 A29
-WRITE TEST447 B15
-* Where code really begins This is for 2 columns of numbers, need to add more code for each extra column
SET ASNAMES=ON
TABLE FILE TEST446
PRINT COMPUTE
NUM2/I02=NUM1; AS NUM2
NUM2
BY NAME
ON TABLE HOLD
MORE
FILE TEST446
END
TABLE FILE HOLD
PRINT 
COMPUTE CNTR/I04=IF NAME NE LAST NAME THEN 1 ELSE CNTR+1; NOPRINT
COMPUTE NUMBER/I02=IF CNTR EQ 1 THEN E02 ELSE E04;
BY NAME
ON TABLE HOLD AS PERSON FORMAT FOCUS INDEX NUMBER
END
-RUN
TABLE FILE TEST447
PRINT COMPUTE
NUM2/I02=NUM1; AS NUM2
NUM2
BY DEPT
ON TABLE HOLD
MORE
FILE TEST447
END
TABLE FILE HOLD
PRINT 
COMPUTE CNTR/I04=IF DEPT NE LAST DEPT THEN 1 ELSE CNTR+1; NOPRINT
COMPUTE NUMBER/I02=IF CNTR EQ 1 THEN E02 ELSE E04;
BY DEPT
ON TABLE HOLD AS DEPT FORMAT FOCUS
END
-RUN
JOIN NUMBER IN DEPT TO ALL NUMBER IN PERSON
TABLE FILE DEPT
SUM CNT.NUMBER
ACROSS NAME ROW-TOTAL
BY DEPT COLUMN-TOTAL
END

This message has been edited. Last edited by: Alan B,


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
Zippo

Suppose your first table is tblNames
and the master is

FILENAME=TBLNAMES, SUFFIX=FIX
SEGNAME=SEG1, SEGTYPE=S1
FIELDNAME=NAAM, ALIAS=NAAM, FORMAT=A25, $
FIELDNAME=NUMBER1, ALIAS=NUMBER1, USAGE=I5, $
FIELDNAME=NUMBER2, ALIAS=NUMBER2, FORMAT=I5, $


you can say

SET ASNAMES=ON
TABLE FILE TBLNAMES
PRINT NAAM
BY NUMBER1 AS NUMT
ON TABLE HOLD AS NAMES
MORE 
FILE TBLNAMES
PRINT NAAM
BY NUMBER2 AS NUMT
END
TABLE FILE NAMES
PRINT NAAM
BY NUMBER 
ON TABLE HOLD AS NAMES2 FORMAT FOCUS INDEX NUMT
END


Now you do the same with the department table (in the same fex)

Then you have two Focus format tables (NAMES2 and DEPT2)
They both have the field NUMT as index field.

You can join these two tables as described before.




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
Virtuoso
posted Hide Post
hi Alan.....great minds.....




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
Virtuoso
posted Hide Post
and fools seldom differ! Confused


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Member
posted Hide Post
Brilliant.

This got me very far. I am having another problem now I am trying to sort out. If I need help I will start a new thread.

Thanks Again,

Zippo
 
Posts: 12 | Location: New Yawk | Registered: February 16, 2006Report 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     Compare sets of numbers

Copyright © 1996-2020 Information Builders