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] Distinct values in maintain stack

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Distinct values in maintain stack
 Login/Join
 
Guru
posted
Hi All,
I have a DB table column. I want to fetch only distinct values of that column in stack and then populate a combox with those values. e.g, In CAR, We have COUNTRY column which has multiple instances of same values. I want to fetch only distinct values ENGLAND,JAPAN,ITALY and W GERMANY in a stack and then associate it with ComboBox so that in dropdown, only these values appears once. How can we achieve this? Please Suggest.

Thanks in advance.

This message has been edited. Last edited by: Kerry,
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Virtuoso
posted Hide Post
The easiest approach is to EXEC a focexec to retrieve the values using a BY fld. It would generally be a rule of thumb that list boxes and combo boxes are populated like this.

Trying to do this based on the values in a stack is doable but much more complex.

For example, to get a unique list of midinitial from an EMPDATA stack called empStack into initStack Mid:
case popStack
Declare (i/i4;j/i4;);
j=2;
stack sort empStack by midinitial;
repeat empStack.foccount i = 1;
if i eq 1 begin 
  initStack(i).Mid = empStack(i).midinitial;
  goto endrepeat;
endbegin
if empStack(i).midinitial eq empStack(i-1).midinitial goto endrepeat;
initStack(j).Mid = empStack(i).midinitial;
j=j+1;
endrepeat i=i+1;
EndCase


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Guru
posted Hide Post
Thanks a lot Alan B.

Warm Regards,
Anil


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
 
Posts: 281 | Location: India | Registered: April 21, 2007Report This Post
Gold member
posted Hide Post
Hi,

Can somebody help me with easier approach of calling a focexec to get the distinct values in a dropdown on a maintain screen.

Regards,
Chirag
7.6.11
OS: Linux
 
Posts: 69 | Registered: February 15, 2008Report This Post
Virtuoso
posted Hide Post
Chirag

This is basic Maintain code covered on the training courses. It is essential that you take these courses.

To call a focexec:
MAINTAIN

$$Declarations

Case Top
$$ Create a stack field to take the focexec output.
empStack.DEPARTMENT/a10;
$$ Call the focexec, simple approach
exec getDepartment into empStack;
Winform Show Form1; 
EndCase

END
and the focexec getDepartment:
TABLE FILE EMPLOYEE
BY DEPARTMENT
ON TABLE PCHOLD
END

Ensure that you have a stack field with field name and format matching the output of the focexec.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
I use this method when trying to get the distinct categories from the Movies file. Table has a DST operator that works great. In my Maintain I have:

EXEC GetCats INTO CATSTK


And GetCats is:
TABLE FILE MOVIES
PRINT DST.CATEGORY
ON TABLE PCHOLD
END
-RUN

Just remember to INFER CATSTK before the exec.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Gold member
posted Hide Post
Thanks Alan for the response. I had been away from maintain for couple of years. Again, had to deliver something. Thanks for your prompt response.

Regards,
Chirag
 
Posts: 69 | Registered: February 15, 2008Report 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] Distinct values in maintain stack

Copyright © 1996-2020 Information Builders