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] Combine Multi Value fields into single value

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Combine Multi Value fields into single value
 Login/Join
 
Member
posted
I'm sure this is very simple to do but I can't seem to find an explanation in the documentation or by searching.

I have a mysql table that looks like this:

ID POS TYPE
10 1 ABC
10 2 XYZ

And I would like the report to look like:
ID TYPE
10 ABC, XYZ

I've tried summing on the type field but that only returns the first value.

Thank you, any help would be appreciated!

This message has been edited. Last edited by: FP Mod Chuck,


Donald

WebFOCUS 8.1.04
Windows Server, Win10
Excel, PDF, HTML
 
Posts: 14 | Registered: February 13, 2015Report This Post
Expert
posted Hide Post
Is output a concatenated list of TYPEs ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Hi Waz, yes that is correct.


Donald

WebFOCUS 8.1.04
Windows Server, Win10
Excel, PDF, HTML
 
Posts: 14 | Registered: February 13, 2015Report This Post
Master
posted Hide Post
Here's out I do this:
TABLE FILE CAR
PRINT CAR
      COMPUTE SAME_COUNTRY/I1=COUNTRY EQ LAST COUNTRY; NOPRINT
      COMPUTE WK_CAR/A18=IF SAME_COUNTRY EQ 0 THEN CAR ELSE '; ' | CAR; NOPRINT
      COMPUTE CAR_LEN/I6=ARGLEN(17,WK_CAR,'I6'); NOPRINT
      COMPUTE TOTAL_LEN/I6=IF SAME_COUNTRY EQ 0 THEN CAR_LEN ELSE LAST TOTAL_LEN+CAR_LEN; NOPRINT
      COMPUTE ALL_CARS/A180=IF SAME_COUNTRY EQ 0 THEN WK_CAR ELSE OVRLAY(ALL_CARS,180,WK_CAR,CAR_LEN,LAST TOTAL_LEN+1,'A180');
   BY COUNTRY
   ON TABLE SET HOLDLIST PRINTONLY
   ON TABLE HOLD
END
TABLE FILE HOLD
  SUM LST.ALL_CARS
   BY COUNTRY
END


One thing to consider is the maximum number of CAR values per COUNTRY. This assumes a max of 10 CAR values per COUNTRY.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Master
posted Hide Post
With the power and flexibility of the WebFOCUS language, there is often more than one way of meeting a requirement, giving the developer to freedom to choose what works given the data source, developer experience, maintainability, and so on.

Here is another example using the CAR database as a source:
TABLE FILE CAR
-* How many cars per country?
SUM CNT.CAR NOPRINT
BY  COUNTRY NOPRINT
-* 'Accumulate' car values.
PRINT   COUNTRY AS 'Country'
        CAR     NOPRINT
COMPUTE NEWCAR/A4096V = IF COUNTRY EQ LAST COUNTRY THEN (NEWCAR || ', ') | CAR  ELSE CAR; AS 'Car'
COMPUTE ROW_NUMBER/I5 = IF COUNTRY EQ LAST COUNTRY THEN ROW_NUMBER + 1          ELSE 1;   NOPRINT
BY      COUNTRY NOPRINT
BY      CAR     NOPRINT
-* Take only last row of each country.  
WHERE TOTAL CNT.CAR EQ ROW_NUMBER
END 


  Country     Car             
  -------     ---
  ENGLAND     JAGUAR, JENSEN, TRIUMPH 
  FRANCE      PEUGEOT 
  ITALY       ALFA ROMEO, MASERATI  
  JAPAN       DATSUN, TOYOTA             
  W GERMANY   AUDI, BMW  
 
Posts: 822 | Registered: April 23, 2003Report 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] Combine Multi Value fields into single value

Copyright © 1996-2020 Information Builders