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.
May not be the only way to perform, but it works and we don't have all your needs, so the solution may not be the best one according to the needs.
DEFINE FILE CAR
MODELSHORT/A3 = EDIT(MODEL,'999');
END
TABLE FILE CAR
BY BODYTYPE
BY TOTAL COMPUTE ID/I2 = IF BODYTYPE EQ LAST BODYTYPE THEN LAST ID ELSE ID + 1;
BY MODELSHORT
WHERE SEATS NE '5';
ON TABLE HOLD AS FILTDATA FORMAT FOCUS
END
-RUN
TABLE FILE FILTDATA
SUM MAX.ID AS 'MAXID'
ON TABLE HOLD AS IDMAX FORMAT BINARY
END
-RUN
-READFILE IDMAX
-RUN
-SET &LOOPTIMES = &MAXID;
-SET &LOOPNO = '1';
-REPEAT :LOOP4FILTERS &LOOPTIMES TIMES;
TABLE FILE FILTDATA
BY MODELSHORT
WHERE ID EQ &LOOPNO;
ON TABLE HOLD AS FLT FORMAT ALPHA
END
-RUN
DEFINE FILE CAR
MODELSHORT/A3 = EDIT(MODEL,'999');
END
TABLE FILE CAR
PRINT MODEL
WHERE MODELSHORT IN FILE 'FLT';
-*ON TABLE HOLD FORMAT XLSX
END
-RUN
-SET &LOOPNO = &LOOPNO + 1;
-:LOOP4FILTERS
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
The basics, I'll leave you to read the values in to use within your filters -
DEFINE FILE CAR
MODELSHORT/A3 = EDIT(MODEL,'999');
END
TABLE FILE CAR
SUM COMPUTE MODELS/A30V = IF BODYTYPE NE LAST BODYTYPE THEN ''''||MODELSHORT||'''' ELSE LAST MODELS || ','''||MODELSHORT||'''';
BY BODYTYPE
BY MODELSHORT NOPRINT
WHERE SEATS NE '5';
ON TABLE HOLD AS TEMPHLD1
END
-RUN
TABLE FILE TEMPHLD1
SUM LST.MODELS
BY BODYTYPE
END
-RUN
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, 2004
But I do not get the result as needed: quote:'200','B21','COR','INT'
With Tony sample, you will have it you wish but you need to define a field with a specific length that may not be enough except if you are sure of the maximum number of element that will be included in the filter field where also, you have to add 2 more digit for each value due to the quotes and 1 for the coma.
Using the sample that I gave you with a IN FILE, you don't really mind about the field length. The IN FILE can manage/include thousand of different values that only takes their length (no additional space for quotes or coma), which I think it seems to be less work to manage and more flexible.
But finally it's your call, we're just suggesting solutions.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
You can often get away with using a variable length field but need to be aware of the held format of this type of field so that you do not fall foul of it!
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, 2004
-* File WFT01.fex
DEFINE FILE CAR
MODSHORT/A6='''' || EDIT(MODEL,'999') || ''',';
END
TABLE FILE CAR
BY BODYTYPE
RANKED BY MODSHORT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD
END
TABLE FILE HOLD
SUM MAX.RANK
ON TABLE HOLD AS HRANK
END
-RUN
-READFILE HRANK
-SET &W=&RANK * 6;
-CLOSE HRANK
-RUN
TABLE FILE HOLD
SUM MODSHORT
BY BODYTYPE
ACROSS RANK
ON TABLE SET NODATA ' '
ON TABLE SAVE
END
-RUN
-SET &L=&LINES;
-REPEAT #FILTER &L TIMES;
-READ SAVE &BODYT.A12. &MOD.A&W.EVAL.
-* For some reason TRIM doesn't work when there are trailing blanks, so:
-SET &RMOD=RJUST(&W,&MOD,'A&W.EVAL');
-SET &TMOD=TRIM('T',&RMOD,&W,',',1,'A&W.EVAL');
-SET &MODS=LJUST(&W,&TMOD,'A&W.EVAL');
-TYPE &BODYT &MODS
-#FILTER
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006