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] Multiple Default Values

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Multiple Default Values
 Login/Join
 
Silver Member
posted
99% of the time I get tremendous results just searching this forum band finding what I need to point me in the right direction (Thank you to everyone who participates) but this one seems to have stumped me.
I know by it's very nature, a default value is just that, the default, however I am trying to find a way to supply multiple default values.
An example is the CAR fex below.

 
TABLE FILE CAR
PRINT 
     CAR.COMP.CAR
     CAR.CARREC.MODEL
BY  LOWEST CAR.ORIGIN.COUNTRY
WHERE COUNTRY EQ &COUNTRY;
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XLSX
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END
 

At the Prompt, if you type in 'ENGLAND' OR 'FRANCE' (as the full string) then you just get England and France.

We'd like the 'ENGLAND' OR 'FRANCE' to be the default value in the prompt field but when I type that as -DEFAULT &COUNTRY = 'ENGLAND' OR 'FRANCE', it doesn't like it and just has ENGLAND. I've tried what seems to all sorts of combinations of quotes, single quotes and double quotes but can't seem to get it.

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


WF 81.5, Windows7
AS/400 Database.
All Outputs

 
Posts: 46 | Registered: November 26, 2008Report This Post
Virtuoso
posted Hide Post
Autoprompt allows you to pick one default which is usually the first value on the list. You can let them multiselect by using this code:

WHERE CAR.ORIGIN.COUNTRY EQ &COUNTRY.(OR(<ENGLAND>,<FRANCE>,<ITALY>,<JAPAN>,<W GERMANY>)).COUNTRY:.;



WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
Don't hard-code, get your values from a table/DB:

WHERE CAR.ORIGIN.COUNTRY EQ &COUNTRY.(OR(FIND COUNTRY IN CAR)).Select Country.;


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
Had a feeling that we could only select a single default value.
We were trying to get away from the drop down option due to the fact that they select the same 5 options 95% of the time and only very occasionally have to change the selection. Plus the users like the report pretty much done for them so they just click submit.

I figured I'd add an option to the report where they can run it either using the pre-defined selection or with the dropdown selection.

 
-SET &SELECTION = &SELECTION.(<Pre Defined Parameters,PRE>,<Select From List Below,SEL>).;
- IF &SELECTION = 'PRE' THEN GOTO PRE
- ELSE IF &SELECTION = 'SEL' THEN GOTO SEL
- ELSE GOTO Label1;

-Label1 TYPE 'Select Report Run Option'
-EXIT

-PRE
TABLE FILE CAR
PRINT 
     CAR.COMP.CAR
     CAR.CARREC.MODEL
BY  LOWEST CAR.ORIGIN.COUNTRY
WHERE COUNTRY EQ 'ENGLAND' OR 'FRANCE';
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XLSX
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END
-EXIT

-SEL
TABLE FILE CAR
PRINT 
     CAR.COMP.CAR
     CAR.CARREC.MODEL
BY  LOWEST CAR.ORIGIN.COUNTRY
WHERE CAR.ORIGIN.COUNTRY EQ &COUNTRY.(OR(FIND COUNTRY IN CAR)).Select Country.;
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XLSX
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END
-EXIT

 


WF 81.5, Windows7
AS/400 Database.
All Outputs

 
Posts: 46 | Registered: November 26, 2008Report This Post
Platinum Member
posted Hide Post
What about this ...

-*
-DEFAULT &COUNTRY = '.'
-*
-SET &COUNTRY = IF &COUNTRY EQ '.' THEN '''ENGLAND'' OR ''FRANCE''' ELSE '''&COUNTRY.EVAL''';
-*
-TYPE COUNTRY ----- &COUNTRY
-*-EXIT
-*
TABLE FILE CAR
PRINT
CAR.COMP.CAR
CAR.CARREC.MODEL
BY LOWEST CAR.ORIGIN.COUNTRY
WHERE COUNTRY EQ &COUNTRY;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
END


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Master
posted Hide Post
This code doesn't give you an auto prompt, but it shows how you can default to more than one option:

-DEFAULT &COUNTRY='''ENGLAND'' OR ''FRANCE''';

TABLE FILE IBISAMP/CAR
PRINT 
     CAR.COMP.CAR
     CAR.CARREC.MODEL
BY  LOWEST CAR.ORIGIN.COUNTRY
WHERE CAR.ORIGIN.COUNTRY EQ &COUNTRY.(OR(FIND COUNTRY IN CAR)).Select Country.;
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Silver Member
posted Hide Post
Thanks jfr99, that works exactly like we want/need it to.


WF 81.5, Windows7
AS/400 Database.
All Outputs

 
Posts: 46 | Registered: November 26, 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] Multiple Default Values

Copyright © 1996-2020 Information Builders