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.
Are you trying to do this via the GUI? If so, have you tried a UNION? I don't know if it'll take it, but you could try typing this directly int the SQL: SELECT ZONE, '1' AS MONTH, UJAN AS UNITS FROM UNION SELECT ZONE, '2' AS MONTH, UFEB AS UNITS FROM UNION . . .
etc.
If it won't allow you to do this (and I suspect it won't), are you open to creating a Data Migrator stored procedure? That way, you can use plain old FOCUS, hold off the results, then use the hold file as the source in your data flow. If you're interested, let me know your email address and I'll send you a write up on how to do that. That's actually what I do most of the time. I do very little via the GUI.
As for how to do this with FOCUS, I have seen several write ups on this sort of thing. I believe the McGuyver technique was created just for this sort of thing. And there is always MATCH, but that can be inefficient depending on your data. Or, if your source is an RDBMS table, you could do a SQL pass-thru and still do a UNION.
Data Migrator 5.3, 7.1, 7.6 WebFOCUS 7.1, 7.6, 7.7 SQL Server, Oracle, DB2 Windows
You could indeed create a DBMS SQL flow and do a UNION. It's a lot of typing tho, you need a dozen select statements one for each month.
If a FOCUS programmer should read this entry they will surely start blabbering about that 1980's TV show.
But there is a simple DataMigrator solution using another standard SQL construct however, the CROSS JOIN.
Create a synonym with just one column: FILENAME=mnths, SUFFIX=SQLMSS , $ SEGMENT=MNTHS, SEGTYPE=S0, $ FIELDNAME=MNTH, ALIAS=MNTH, USAGE=I5, ACTUAL=I2, $
Then use the DMC to create the table and to insert twelve (12) rows of data. That gets us the numbers 1 through 12.
Next create a new flow and join the source table to the months table and select a join type of CROSS JOIN which doesn't require any join conditions.
That gives us a so-called cartesian product, every possible combination of the rows from the right and left tables. So with 12 months, if there are two rows in your source, we will get back 12 x 2 or 24 rows, one for each month for each source row.
So now you can simply select ZONE and MNTH. For UNITS we need to specify which month's units to use and that can be done with a CASE statement which you can actually type into the calculator:
CASE WHEN T2.MNTH = 1 THEN JAN WHEN T2.MNTH = 2 THEN FEB WHEN T2.MNTH = 3 THEN MAR WHEN T2.MNTH = 4 THEN APR WHEN T2.MNTH = 5 THEN MAY WHEN T2.MNTH = 6 THEN JUN WHEN T2.MNTH = 7 THEN JUL WHEN T2.MNTH = 8 THEN AUG WHEN T2.MNTH = 9 THEN SEP WHEN T2.MNTH = 10 THEN OCT WHEN T2.MNTH = 11 THEN NOV WHEN T2.MNTH = 12 THEN DEC END
Here I assumed that the column names were the three letter month abbreviations.This message has been edited. Last edited by: Clif,
N/A
Posts: 397 | Location: New York City | Registered: May 03, 2007
You didn't mention what kind of table it is but if you can make it be a fixed file, you can use an alternate master with an OCCURS in it to do exactly what you want.