Virtuoso
| 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, 2007 |
IP
|
|
Master
| 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, 2009 |
IP
|
|
Virtuoso
| 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, 2007 |
IP
|
|
Member
| 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, 2010 |
IP
|
|