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] Another Guided Ad-Hoc 'how to code' question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Another Guided Ad-Hoc 'how to code' question
 Login/Join
 
Gold member
posted
The sales transactions in our database all have a "sales source" attached to them. Right now, the guided ad-hoc tool we have built defaults to certain sales sources only. We have a request to open up all sales sources to the user. However, most of the time they will only need these "default sales sources"

I've thought through a couple ways to do this..Radio buttons - 1 for default, the other would be selected and then that would open up a multi-select list of available sales sources to choose from (chaining?). The second way is to list all 9 sources as checkboxes, with the first one being 'default'.

I would have to dynamically build the WHERE statement on what the user chooses, but I'm having trouble with this.

Any guidance or suggestions are greatly appreciated!

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


WebFOCUS 7.7.03
Linux / Universe Db
HTML/PDF/EXCEL/HTML Active
 
Posts: 90 | Registered: November 03, 2009Report This Post
Gold member
posted Hide Post
If I am understanding your question right, you are looking to build a WHERE clause that can change based on the user input. The input can be either a Multi-select List box or a number of different check boxes. I have pasted some code below that should help you build a dynamic WHERE clause.

The first code here is for a Multi-select listbox.

 
-DEFAULT &MULTIVAR = ' ';

-SET &MULTIVAR = IF &MULTIVAR EQ ' ' THEN 'FOC_NONE' ELSE UPCASE(75,&MULTIVAR,&MULTIVAR);

TABLE FILE CAR
PRINT 
     'CAR.CARREC.MODEL'
     'CAR.BODY.BODYTYPE'
BY 'CAR.ORIGIN.COUNTRY'
BY 'CAR.COMP.CAR'
HEADING
""
FOOTING
""
WHERE CAR.ORIGIN.COUNTRY EQ &MULTIVAR;
END


The next set of code is for multiple checkbox options.
 
-DEFAULT &VAR1 = ' ';
-DEFAULT &VAR2 = ' ';
-DEFAULT &VAR3 = ' ';
-DEFAULT &VAR4 = ' ';


-SET &VAR1 = IF &VAR1 EQ ' ' THEN 'FOC_NONE' ELSE UPCASE(20,&VAR1,&VAR1);
-SET &VAR2 = IF &VAR2 EQ ' ' THEN 'FOC_NONE' ELSE UPCASE(20,&VAR2,&VAR2);
-SET &VAR3 = IF &VAR3 EQ ' ' THEN 'FOC_NONE' ELSE UPCASE(20,&VAR3,&VAR3);
-SET &VAR4 = IF &VAR4 EQ ' ' THEN 'FOC_NONE' ELSE UPCASE(20,&VAR4,&VAR4);

TABLE FILE CAR
PRINT 
     'CAR.CARREC.MODEL'
     'CAR.BODY.BODYTYPE'
BY 'CAR.ORIGIN.COUNTRY'
BY 'CAR.COMP.CAR'
HEADING
""
FOOTING
""
WHERE CAR.ORIGIN.COUNTRY EQ '&VAR1.EVAL' OR '&VAR2.EVAL' OR '&VAR3.EVAL' OR '&VAR4.EVAL';
END


I hope this helps.

Thanks,
Dave


WebFOCUS 7.7.03
Windows Web Server 2008
MS SQL Server 2000
Excel,CSV,PDF,HTML
 
Posts: 71 | Location: Kingston, ON | Registered: May 03, 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] Another Guided Ad-Hoc 'how to code' question

Copyright © 1996-2020 Information Builders