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     Combine the data from 20 fields into one

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Combine the data from 20 fields into one
 Login/Join
 
Member
posted
I am trying to make a field that holds the values of 20 other fields so that I can create a drop down list for a parameter. For example I have twenty fields which are labels (label1, label2, label3, label4, label5, etc.) I would like a new field that holds all of the values from the labels so that I have one list of all labels.

Is there a way to take the values of 20 different fields and combine them into a new field name.

Below is my attempt at a new define, however I only obtained data from BUSCODE1 and all remaining BUSCODE fields were ignored once it found data in BUSCODE1.

DEFINE FILE AUTHORIZATIONS
BUS_VALUE/A50=
IF BUSCODE1 NE '' THEN BUSCODE1 ELSE
IF BUSCODE2 NE '' THEN BUSCODE2 ELSE
IF BUSCODE3 NE '' THEN BUSCODE3 ELSE
IF BUSCODE4 NE '' THEN BUSCODE4 ELSE
IF BUSCODE5 NE '' THEN BUSCODE5 ELSE
IF BUSCODE6 NE '' THEN BUSCODE6 ELSE
IF BUSCODE7 NE '' THEN BUSCODE7 ELSE
IF BUSCODE8 NE '' THEN BUSCODE8 ELSE
IF BUSCODE9 NE '' THEN BUSCODE9 ELSE
IF BUSCODE10 NE '' THEN BUSCODE10 ELSE
IF BUSCODE11 NE '' THEN BUSCODE11 ELSE
IF BUSCODE12 NE '' THEN BUSCODE12 ELSE
IF BUSCODE13 NE '' THEN BUSCODE13 ELSE
IF BUSCODE14 NE '' THEN BUSCODE14 ELSE
IF BUSCODE15 NE '' THEN BUSCODE15 ELSE
IF BUSCODE16 NE '' THEN BUSCODE16 ELSE
IF BUSCODE17 NE '' THEN BUSCODE17 ELSE
IF BUSCODE18 NE '' THEN BUSCODE18 ELSE
IF BUSCODE19 NE '' THEN BUSCODE19 ELSE
IF BUSCODE20 NE '' THEN BUSCODE20 ELSE 'NONE';
END


7.6.8
Windows xp
html
 
Posts: 22 | Location: Minneapolis, MN | Registered: January 24, 2008Report This Post
Expert
posted Hide Post
LDW,

Can't test, so, here's a best guess. Other's may have idea's to assist:

 
-SET &ECHO=ALL;
-SET &CNTR = 1;
 
SET ASNAMES = ON

DEFINE FILE AUTHORIZATIONS
     PUT_ALL_FIRST/A50 = 'All';
-REPEAT DEF_COLS 20 TIMES
    BUS_CODE&CNTR/A50 = IF BUSCODE&CNTR NE '' THEN BUSCODE&CNTR ELSE ' ';
-SET &CNTR = &CNTR + 1;
-DEF_COLS
END
-SET &XCNTR1 = 1;
-SET &XCNTR2 = 1;
TABLE FILE AUTHORIZATIONS
SUM
    PUT_ALL_FIRST AS 'BUS_CODE'
-REPEAT PRT_COLS 20 TIMES
    BUS_CODE&XCNTR1 AS 'BUS_CODE' 
-SET &XCNTR1 = &XCNTR1 + 1;
-PRT_COLS
   BY PUT_ALL_FIRST AS 'BUS_CODE'
-REPEAT SORT_COLS 20 TIMES
  BY BUS_CODE&XCNTR2 AS 'BUS_CODE'
-SET &XCNTR = &XCNTR2 + 1;
-SORT_COLS
-* 
Put your WHERE test(s) here
-*
 ON TABLE HOLD AS BUSCODES FORMAT XML
END
-EXIT


You only showed 20 columns, so, I hard-coded 20.

Now, you should have 21 values that includes ALL, unless they are blank.

Hope this helps...

Tom

EDIT:
Coding ERROR:

ON TABLE HOLD AS BUSCODES FORMAT XML
S/B
ON TABLE PCHOLD FORMAT XML

OOPPSS!!

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
This sounds like another perfect application for the McGuyver Technique! See https://forums.informationbuilders.com/eve/forums/a/tpc/...1057331/m/3221072782

Set up the McGuyver Master and data files as Danny-SRL described, then your code will look something like this:

FILEDEF FSEQ DISK C:\ibi\apps\focalpoint\fseq.dat

JOIN BLANK WITH DEPT IN AUTHORIZATIONS
TO BLANK IN FSEQ AS M_
END

DEFINE FILE AUTHORIZATIONS
BLANK/A1 WITH BUSCODE1=' ';
BUSVALUE/A50=IF COUNTER EQ 1 THEN BUSCODE1 ELSE
IF COUNTER EQ 2 THEN BUSCODE2 ELSE
...
IF COUNTER EQ 20 THEN BUSCODE20 ELSE '';
END

TABLE FILE AUTHORIZATIONS
PRINT BUSVALUE
WHERE COUNTER LE 20
ON TABLE PCHOLD AS CODELIST FORMAT XML
END


Jeff
WebFOCUS 8.0.09, Unix-Win-z/OS
FOCUS 7.3.1 on z/OS
 
Posts: 34 | Location: Minneapolis, MN | Registered: June 10, 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     Combine the data from 20 fields into one

Copyright © 1996-2020 Information Builders