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] Unequality in JOINs?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Unequality in JOINs?
 Login/Join
 
Virtuoso
posted
I'm working with some temporal data at the moment, which got me wondering if there's some trick to perform joins with that table. Up until now we've always created a hold-file with some discrete key to give us a column to join to, but that approach isn't always going to help us I expect...

The table at hand is one containing currencies and exchange rates at the dates those changed. I have to join a table with financial data against that, so I can sum up the totals per year.

For example, we have:
 Code | Start   | Expired | Rate
------+---------+--------------------
 USD  | 1100331 | 1100531 | 1.351351
      | 1100531 | 1100930 | 1.230012
      | 1100930 |    NULL | 1.333333
 GBP  | 1100531 | 1100630 | .869565
      | 1100630 |    NULL | .826446


Now if I have a record:
 Date    | Customer | Amount
---------+----------+--------
 1100603 |      127 | 534.21


How do I join those two?
In SQL I would write something like:
SELECT t1.Amount/t2.Rate AS 'Amount', t1.Customer, t1.Date
  FROM ledger AS t1
 INNER JOIN exchange_rates AS t2 ON (t1.Date BETWEEN t2.Start AND t2.Expired)
(I'm ignoring the NULL-case to keep the example simple)

Is something like this possible in WebFOCUS?

I suppose I could use MacGuyver to join that exchange-rate table in such a way that there would be an exchange-rate record for every given date. That does seem a bit excessive though?

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


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
Look up documentation on 'Conditional Joins'. It is especially created for this kind of things.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
Thanks, that looks like what I'm looking for.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report 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] Unequality in JOINs?

Copyright © 1996-2020 Information Builders