Focal Point
[SOLVED] Issue with merge records.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4317018436

November 21, 2013, 10:31 AM
hainguyen
[SOLVED] Issue with merge records.
I have this issue and this is the sample code:
  
TABLE FILE HOLD_MAT_RT 
	 PRINT LTEXT AS 'Long Text'
	 BY MATNR AS 'Material Number'
	 BY MAKTX AS 'Mat. Description'
ON TABLE PCHOLD FORMAT HTML
END

The output I got is like this:

Material Number   Mat. Description    Long Text
11111             AAAAA               Text1Line1
                                      Text1Line2
                                      Text1Line3
22222             BBBBB               Text2Line1
                                      Text2Line2
                                      Text2Line3

The issue is for material 11111 I have 3 lines of Long Text in 3 separate records. However, my customer want me to merge these 3 records to 1 record. I can display it as 3 lines but when I export them to excel file, it need to be merged into 1 cell. I am not sure is that possible to implement this feature or not. Anybody can give me idea ? 
 

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


WebFOCUS 7.7.03
Windows, All Outputs
November 21, 2013, 11:31 AM
Rifaz
WRAP? SQUEEZE? doesn't help you on this? Data length? Is it possible for you to reproduce using CAR master?


-Rifaz

WebFOCUS 7.7.x and 8.x
November 21, 2013, 11:31 AM
prodrigu
hainguyen,

Can you ask your customer if column Long Text can be all in one column but broken up by commas.

Example:

  
TABLE FILE CAR
PRINT
BODYTYPE
BY COUNTRY
BY CAR
ON TABLE HOLD AS CAR1
END

DEFINE FILE CAR1
CONT/A1    = IF COUNTRY  NE LAST COUNTRY  THEN 'R' ELSE
             IF CAR      NE LAST CAR      THEN 'R' ELSE
             IF BODYTYPE EQ LAST BODYTYPE THEN 'Y' ELSE 'N';
SHOW/A300V = IF CONT EQ 'R' THEN BODYTYPE ELSE
             IF CONT EQ 'Y' THEN SHOW ELSE SHOW | ', ' | BODYTYPE;
END

TABLE FILE CAR1
SUM
SHOW
BY COUNTRY
BY CAR
END



Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
November 21, 2013, 12:28 PM
hainguyen
Instead of concatenating with commas, can we just concatenate with space. I don't think they will agree with commas.


WebFOCUS 7.7.03
Windows, All Outputs
November 21, 2013, 12:39 PM
prodrigu
nainguyen,

Just replace the below piece of code.

  
SHOW/A300V = IF CONT EQ 'R' THEN BODYTYPE ELSE
             IF CONT EQ 'Y' THEN SHOW ELSE SHOW | ' ' | BODYTYPE;



Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
November 21, 2013, 01:30 PM
njsden
Look in your masterfile. It's likely that MAKTX is defined as a TX50 field. Try using a "big" A size, such as A2000 and test to see what happens.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
November 22, 2013, 09:46 AM
hainguyen
Thanks prodrigu, your solution is awesome. Thanks a lot.
Thanks njsden, my issue is solved by prodrigu's solution.

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


WebFOCUS 7.7.03
Windows, All Outputs