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     [CLOSED] Break column data by value

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Break column data by value
 Login/Join
 
Platinum Member
posted
I want to break the data of a column by value.

Suppose that in my report I have:

------------------------
ColName |
------------------------
value1, value2, value3 |
------------------------
value1, value2 |
------------------------

I want to break the data by the semicolon. Something like these:

-----------------
ColName |
-----------------
value1, |
value2, |
value3 |
-----------------
value1, |
value2 |
-----------------

Thanks,
Carlos Dias

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


WebFOCUS version: 7.6
Linux/Windows
HTML, Excel
 
Posts: 127 | Location: Aveiro, Portugal | Registered: February 04, 2011Report This Post
Member
posted Hide Post
I'm not sure I get what you try to achieve, but i could be using multiple BY clauses?
or you can try to use the ACROSS clause which will sort of transpose your data, if you post an actual example it will be easier to help.


WebFocus 768
Windows, all output
 
Posts: 18 | Registered: June 20, 2011Report This Post
Expert
posted Hide Post
If you want to split the values in the column into rows, then you will need to use the Macgyver technique.

There are many examples on the forum.


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
Guru
posted Hide Post
Are you trying to Split the Data (Not entire Row... But a single Data, column value) using a Delimiter? Or something else ?


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Report This Post
Platinum Member
posted Hide Post
Ramkumar you are right I'm trying to split the data.

I want to transform this (the "ColName1"):


In


Thanks,
Carlos Dias


WebFOCUS version: 7.6
Linux/Windows
HTML, Excel
 
Posts: 127 | Location: Aveiro, Portugal | Registered: February 04, 2011Report This Post
Expert
posted Hide Post
Here is an example that does what I think you want.

-* Write out a master to read the TST_DATA list
EX -LINES 5 EDAPUT MASTER,TST_DATA,CV,FILE
FILENAME=TST_DATA, SUFFIX=FIX,$
SEGNAME=TST_DATA, $
  FIELD=ColName2 ,ALIAS=  ,A3 ,A3 ,$
  FIELD=ColName1 ,ALIAS=  ,A50 ,A50 ,$


EX -LINES 4 EDAPUT FOCTEMP,TST_DATA,CV,FILE
123abc1, abc2, abc3, abc4
456abc1, abc2, abc3
789abc1, abc2

FILEDEF TST_DATA DISK tst_data.ftm (LRECL 80 RECFM V

-RUN


EX -LINES 7 EDAPUT MASTER,fseq,CV,FILE
 FILE=FSEQ, SUFFIX=FIX
  SEGNAME=SEG1
   FIELD=CONTROL, BLANK , A1, A1, $
  SEGNAME=SEG2, PARENT=SEG1, OCCURS=VARIABLE
   FIELD=WHATEVER, , A1, A1, $
   FIELD=COUNTER, ORDER, I4,  I4,$

FILEDEF FSEQ DISK fseq.mas (LRECL 1000

TABLE FILE FSEQ 
PRINT COUNTER
BY    CONTROL
WHERE RECORDLIMIT EQ 10
ON TABLE HOLD AS FOC_FSEQ FORMAT FOCUS INDEX CONTROL
END

JOIN BLANK WITH ColName2 IN TST_DATA TO ALL CONTROL IN FOC_FSEQ

DEFINE FILE TST_DATA
 BLANK/A1 WITH ColName2 = ' ' ;
END

TABLE FILE TST_DATA
PRINT ColName1
      COMPUTE Item/A5 = LJUST(5,GETTOK(ColName1,50,COUNTER,',',5,'A5'),'A5') ;
BY    ColName2
BY    COUNTER
WHERE TOTAL Item NE ' '
END


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
Platinum Member
posted Hide Post
I tried a simpler approach:

DEFINE FILE CAR
STRING/A200='abc1, abc2, abc3, abc4, abc5';
ASTRING/A100V = STRREP(200,STRING,1,',',6,',<br>',100,ASTRING);
END

TABLE FILE CAR
PRINT
COUNTRY
STRING
ASTRING
END


Result:


Using the break HTML works... but I want to break in the second semicolon. So I want something like:
ASTRING
-------------
abc1, abc2,
abc3, abc4,
abc5

Thanks,
Carlos Dias


WebFOCUS version: 7.6
Linux/Windows
HTML, Excel
 
Posts: 127 | Location: Aveiro, Portugal | Registered: February 04, 2011Report This Post
Expert
posted Hide Post
Use style sheet control -

DEFINE FILE CAR
  STRING/A200='abc1, abc2, abc3, abc4, abc5';
END

TABLE FILE CAR
PRINT STRING
   BY COUNTRY
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
  TYPE=REPORT, COLUMN=STRING, WIDTH=0.80, WRAP=0.80, $
ENDSTYLE
END

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Nice approach Tony but unfortunately doesn't work in AHTML style.

Thanks,
Carlos Dias


WebFOCUS version: 7.6
Linux/Windows
HTML, Excel
 
Posts: 127 | Location: Aveiro, Portugal | Registered: February 04, 2011Report This Post
Expert
posted Hide Post
quote:
unfortunately doesn't work in AHTML style.

But then I do not see any mention of an AHTML requirement Confused

However, if you include the ON TABLE SET HTMLCSS ON then it does.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Have you tried ACCORDIAN REPORTS?
 
Posts: 30 | Registered: May 26, 2011Report 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     [CLOSED] Break column data by value

Copyright © 1996-2020 Information Builders