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.
i am doing join between two synonym using match tools. the first table has Customer Name , Balance and Amount. the second table has also Customer Name, Balance and Amount. both table hold different values for the measures. the issue when i am doing Join using Match Tools to generate a Report with one dimension and 4 measures it seems that i am reading same fields of measures of first table in the Match request. it should gives me different values for the 4 measures. i.e
Table1 ----------- Customer Name | Balance | Amount john | 10 | 50 Maria | 20 | 70
Table2 ----------- Customer Name | Balance | Amount john | 40 | 30 Maria | 60 | 80
Doing the Match where Customer in the By section as joining key and Balance,Amount in the SUM section.generate the report from the HOLD as BY Customer and print details all the 4 measures gives this result:
Customer Name | Balance | Amount | Balance | Amount john | 10 | 50 | 10 | 50 Maria | 20 | 70 | 20 | 70
i am looking for the following results:
HOLD ----------- Customer Name | Balance | Amount | Balance | Amount john | 10 | 50 | 40 | 30 Maria | 20 | 70 | 60 | 80
i appreciate your help and guidance QalqiliThis message has been edited. Last edited by: Qalqili,
From the looks of your examples would the MORE command work better for you?
TABLE FILE Table1
PRINT
BALANCE
AMOUNT
BY CUSTOMER
-*Where statement for Table1 here
ON TABLE PCHOLD FORMAT HTML
MORE
FILE Table2
-*Where statement for Table2 here
END
Actually, it looks to me that a JOIN would be the way to go as you need to put matching records from both tables in the same row.
JOIN CUSTOMER IN TABLE1 TO ALL CUSTOMER IN TABLE2
TABLE FILE TABLE1
PRINT TABLE1.CUSTOMER
TABLE1.BALANCE AS 'BALANCE_1'
TABLE1.AMOUNT AS 'AMOUNT_1'
TABLE2.BALANCE AS 'BALANCE_2'
TBALE2.AMOUNT AS 'AMOUNT_2'
END
If you need all data from TABLE1 even when no matching records exist in TABLE2, then you'll need a LEFT OUTER JOIN there to help you.
Now, if you need any records from either TABLE1 or TABLE2 regardless of the existence of matching information in each other table then you will definitely need to use MATCH OLD-OR-NEW logic.
In creating test data, I was able to get the desired results using the MATCH logic in the initial request:
TABLE FILE CAR
PRINT
COMPUTE CUST_NAME/A10 = ' ';
COMPUTE BALANCE/I5 = 0;
COMPUTE AMOUNT/I5 = 0;
BY COUNTRY NOPRINT
IF RECORDLIMIT EQ 1
ON TABLE HOLD AS TABLE1 FORMAT ALPHA
END
-RUN
HOLD AS TABLE2 FORMAT ALPHA
-WRITE TABLE1 JOHN 10 50
-WRITE TABLE1 MARIA 20 70
-CLOSE TABLE1
-RUN
-WRITE TABLE2 JOHN 40 30
-WRITE TABLE2 MARIA 60 80
-CLOSE TABLE2
-RUN
MATCH FILE TABLE1
SUM
BALANCE
AMOUNT
BY CUST_NAME
RUN
FILE TABLE2
SUM
BALANCE
AMOUNT
BY CUST_NAME
AFTER MATCH HOLD AS TEST3 OLD-OR-NEW
END
-RUN
TABLE FILE TEST3
PRINT *
END
-RUN
CUST_NAME BALANCE AMOUNT BALANCE AMOUNT
JOHN 10 50 40 30
MARIA 20 70 60 80
your code works well , i wounder is there a technique to diffrentiate the Measures from each other. i.e if i want to make a compute to take the difference from first Amount and first Balance and another compute to take the difference from secound Amount and second Balance from table2.
Regards QalqiliThis message has been edited. Last edited by: Qalqili,
MATCH FILE TABLE1
SUM
BALANCE AS BALANCE1
AMOUNT AS AMOUNT1
BY CUST_NAME
RUN
FILE TABLE2
SUM
BALANCE AS BALANCE2
AMOUNT AS AMOUNT2
BY CUST_NAME
AFTER MATCH HOLD AS TEST3 OLD-OR-NEW
END
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007