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] CELLS MERGE

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] CELLS MERGE
 Login/Join
 
Member
posted
hello
I would like to know how to merge Excel lines with newlines if it is the same key.
Thank for all.

DEFINE FILE RESERV
LG_4CMD/A800 = IF ITEM2 EQ LAST THEN SUBSTR(800, LG_4CMD, 1, 400, 400, 'A400') || CHAMP ELSE CHAMP || '
';
END

TABLE FILE RESERV
LG_4CMD AS 'Liste des Cmdes magasin'
ON TABLE HOLD AS TAB_FINA FORMAT HTMTABLE
END

SET HTMLFORMTYPE=XLS
-*-SET HTM
-RUN
-HTMLFORM BEGIN





!IBI.FIL.TAB_FINA;

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


WebFOCUS 7.6.9
Windows
(Excel, HTML, PDF)
 
Posts: 2 | Location: France | Registered: March 11, 2010Report This Post
Virtuoso
posted Hide Post
I see a couple of issues with your code:

1. Your DEFINE syntax is not quite correct.
2. You are missing a verb (PRINT, SUM) in your TABLE request.
3. Using a DEFINE assumes the data is already sorted in proper order; if not, you should sort the data in your TABLE request and use a COMPUTE instead of a DEFINE.
4. Using a variable length field (A800V) with hard concatenation (||) is simpler and safer than using function SUBSTR, unless you use function ARGLEN in conjunction with SUBSTR.

Your code should probably look more like this:

TABLE FILE RESERV
 PRINT
 COMPUTE LG_4CMD/A800V = IF ITEM2 EQ LAST ITEM2 THEN (LG_4CMD || (' ' | CHAMP)) ELSE CHAMP ; AS 'Liste des Cmdes magasin'
 BY ITEM2 NOPRINT
 BY CHAMP NOPRINT
 ON TABLE HOLD AS TAB_FINA FORMAT HTMTABLE
END
.
.
.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Master
posted Hide Post
Are you looking for something like this?
TABLE FILE CAR
BY COUNTRY
BY CAR
ON TABLE HOLD
END

DEFINE FILE HOLD
CAR_CON/A400V=IF COUNTRY EQ LAST COUNTRY THEN (CAR_C|| (' ' | CAR))  ELSE CAR;
END
TABLE FILE HOLD
SUM
LST.CAR_CON AS 'Car Concatenated'
BY COUNTRY  AS 'Country'
END
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Virtuoso
posted Hide Post
I think this may be helpful:
DEFINE FILE CAR
CR/A1=HEXBYT(10,CR);
TESTSTR/A200V = IF COUNTRY EQ LAST COUNTRY THEN
                TESTSTR || CR || CAR ELSE CAR;
END
TABLE FILE CAR
PRINT TESTSTR
ON TABLE PCHOLD FORMAT EXL2K
END
Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Member
posted Hide Post
Hello,
Yes it works is fantastic,
thank you for all.


WebFOCUS 7.6.9
Windows
(Excel, HTML, PDF)
 
Posts: 2 | Location: France | Registered: March 11, 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] CELLS MERGE

Copyright © 1996-2020 Information Builders