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 have come across an issue that I don't know how to fix. I have a report that requires a join from a reference table to a fact table. The reference table is a dimension that has the highest to lowest levels of data. (example: Country, State, County, Employee)
I have a fact table that is about 80 million rows in Oracle that contains the State only. I need to join the two together and doing it as a hold file makes me believe it will then want to bring back the fact data on the application server.
In SQL I would do something like this:
select state, sum(x) from fact_table, (select distinct state from reference) where state = state.
How do I do this and keep the work on the database?
Posts: 62 | Location: Rochester, NY | Registered: September 30, 2005
I am not 100% sure on your post. I read that as get the data summed by state and then join that back to my reference table on state.
The reference table would look something like this:
Reference Table
CC ST CITY
------------------
US NY BUFFALO US NY SYRACUSE US NY ROCHESTER
Fact Table ST Metric ------------- NY 5 NY 10 NY 20 ------------- NY 35 *Result from SUM(Metric) by state
If I then join back I get this as a dataset: NY 35 (match for Buffalo) NY 35 (match for Syracuse) NY 35 (match for Rochester) -------------- NY 105 *results due to city records in reference
I'm somewhat new to the product so maybe what you said get me at the distinct states. Did I understand it correctly?This message has been edited. Last edited by: <Maryellen>,
No only the join from reference to fact_table and do the summing in the fex, however, you really want the 'unique sum for the state' correct? What do you want your report to be. Understanding what you want to do helps. What I said earlier may not work as multiple references for state joining to multiple in fact_table may not get all your data. So back to square one so to speak.
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004
I'm not quire sure what you need here. Forgive me I think it is me, and not you. If your fact table has only the state and the amount, then why do you need the reference table at all, as SUM amount BY STATE should give you what you need. Once you include in the cities, then ytou do have a many-to-many situation. No, maybe you have other information at the STATE level, that you do need. I would suggest that in this case, JOIN might not be the way to go, but MATCH. Let's say that with the reference table, we have not only CITY, but the population of each city. So, I want a report showing the Total POPULATION and the total of the metric. Then, this will do the trick: MATCH FILE REFERENCE SUM POPULATION BY STATE RUN FILE FACT_TABLE SUM METRIC BY STATE AFTER MATCH HOLD AS COMBO END TABLE FILE COMBO PRINT * END The last TABLE would of course have all of the stylesheet formatting, headings, etc.
Posts: 60 | Location: 2 penn | Registered: May 22, 2003
Sorry I should have mentioned that I'm using ID's and not actual state values. I did that for a simpler explanation.
In some cases I need to join because the will want something like give me all the states within the US. So my where clause is on Country and my group by is on state (or it could be city)
My reference table still has duplicate rows in either case when looking at state. So unless I do two distinct pulls it seems I can't get the right number.
I guess I'd like to do this in all one shot without using an intermediate hold file.
I have to look back through the examples that were posted to understand them a bit more.
Posts: 62 | Location: Rochester, NY | Registered: September 30, 2005
If you're using IDs to link from your fact table to your dimension table, then I'm even more baffled. In any dimension table, you need unique IDs for each entry; so your dimension table should look something like this:
Reference Table ID CC ST CITY -- --- --- -------- 11 US NY BUFFALO 22 US NY SYRACUSE 33 US NY ROCHESTER
However, you seem to be implying that you have duplicate IDs in your dimension table. In other words, the IDs are at the State level and you have redundant entries:
Reference Table ID CC ST CITY -- --- --- -------- 99 US NY BUFFALO 99 US NY SYRACUSE 99 US NY ROCHESTER
If you can give us the precise details of your situation with specific examples of the IDs in both the fact and dimension tables, we can help you figure out a solution.
EricHThis message has been edited. Last edited by: <Maryellen>,