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     Multiple Parameter Values

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Multiple Parameter Values
 Login/Join
 
<mhuber>
posted
I'd like to run a report using multiple values for a single parameter. For instance:
TABLE FILE CAR
PRINT CAR
BY COUNTRY
WHERE COUNTRY EQ '&Parm';
END

I'd like to enter both ENGLAND and FRANCE in a single request, rather than running a separate request for each.

Thanks,
Michael
 
Report This Post
Gold member
posted Hide Post
Try this:

TABLE FILE CAR
PRINT CAR
BY COUNTRY
WHERE (COUNTRY EQ &COUNTRY.(OR(ENGLAND,FRANCE,ITALY,JAPAN,W GERMANY)).CHOOSE COUNTRY.);
END

Good luck!
 
Posts: 68 | Location: Springfield MA | Registered: May 07, 2003Report This Post
<mhuber>
posted
That actually didn't do anything different for me.

Also, I don't want to hard-code all the possible values into the report. We add new values to the database relatively often, and we don't want to have to modify all the reports every time.

We came up with a Dialogue Manager solution that seems to get the job done.
If the user's input is:
'ENGLAND, FRANCE'
the DM code translates it to:
'''ENGLAND'' OR ''FRANCE'''
and the resulting WHERE clause is:
WHERE COUNTRY EQ 'ENGLAND' OR 'FRANCE'

Is there a simpler way to do this than using a whole lot of Dialogue Manager?

Thanks,
Michael
 
Report This Post
<NIVAS>
posted
Hi michel
I have a similar kind of problem,would you post that solution please
thanks
 
Report This Post
Gold member
posted Hide Post
Michael,
Are you using Dev Studio, or manually coding your focexecs? Have you tried using the Resource Layout Painter tool? You can create dynamic multi-select drop down boxes using the tool, relatively easily. What happened when you ran the above code? Did you hold down CTRL to multi-select the countries?
 
Posts: 68 | Location: Springfield MA | Registered: May 07, 2003Report This Post
Platinum Member
posted Hide Post
In WebFocus 5.2.3 the way to do this is either
in the Report Painter in the WHERE clause follow the directions, or in language ..
WHERE COUNTRY EQ &CTY.( OR ('ENGLAND', 'FRANCE','DENMARK)).

The text after the first parenthesis is the 'join' value for the items in the multiple select list. The JavaScript is put in automatically by WebFocus.
 
Posts: 226 | Registered: June 08, 2003Report This Post
<mhuber>
posted
Gerald: Again, I DON'T WANT TO HARD-CODE ANYTHING!

Jen: Yes, we're using DevStudio. Unfortunately, the dynamic drop-downs/multi-selects in Resource Layout Painter don't work in our environment. I believe we have a case open with IBI, and they'll fix it in a future release. Once that's working, we'll certainly go that route. We're trying to stay away from "Publishing" the custom HTML pages for each report until everything is working as expected. Consequently, manual JavaScript coding is out as well.

Nivas: Here's the DM code. I haven't tested it to make sure it's bullet-proof, but it seems to work quite well. You can do View Source to see the FOCUS code generated in the WHERE clause. NOTE: As you may have guessed, all the quotes below are 'single' quotes.

-SET &ECHO = ALL;
-DEFAULT &INVAL = '';
-DEFAULT &MYWHERE =' ';
-SET &MYLEN = &MYWHERE.LENGTH;
-SET &OUTVAR = '''' | 'A' | &MYLEN | '''';
-SET &CTR = 1;
-SET &VARST ='A';
-REPEAT ENDLP WHILE &VARST NE ' ';
-SET &VARST = GETTOK(&MYWHERE, &MYLEN, &CTR, ',X' , &MYLEN, &OUTVAR.EVAL);
-IF &VARST EQ ' ' GOTO STOPIT;
-IF &CTR GT 1 GOTO ONEMORE;
-SET &INVAL = &INVAL | '''' | &VARST.EVAL | '''' | ' ';
-GOTO SKIPMORE
-ONEMORE
-SET &INVAL = &INVAL | 'OR ' | '''' | &VARST.EVAL | '''' | ' ';
-SKIPMORE
-TYPE &INVAL.EVAL
-SET &CTR = &CTR + 1;
-ENDLP
-STOPIT
TABLE FILE CAR
PRINT CAR MODEL
BY COUNTRY
WHERE COUNTRY EQ &INVAL
END
 
Report This Post
<mhuber>
posted
There's a slight logic error in the code. If any of the parameter values contains a space, it blows up. This is probably due to &VARST.EVAL in the code.

I'll post a more complete solution once my coworker & I hash it out. I have more pressing issues at the moment, so I won't be able to devote too much time to it right now.

In the mean time, if anyone has any ideas about how to approach this differently, we're open to suggestions!

Thanks,
Michael
 
Report This Post
Platinum Member
posted Hide Post
Michael,

This may do what you want, it is quite similar to your code (I dont use -REPEAT as my version of 4.3.6 doesn't support it, and I haven't installed the new service pack).

The code prompts for &VALUES the total number of selections the user wants to input and uses that to create the selection criteria. The user is prompted for each selection one at a time, and so doesn't have to remember to put in commas or anything, and it doesn't mind spaces. Try it and see if its any good

-PROMPT &VALUES
-RUN
TABLE FILE CAR
PRINT CAR
BY COUNTRY
-SET &COUNTER =0;
WHERE COUNTRY IN
(
-HERE1
-IF &COUNTER LT &VALUES GOTO 1 ELSE GOTO END1;
-1
-PROMPT &TEST.&COUNTER
'&TEST.&COUNTER'
-SET &COUNTER=&COUNTER+1;
-IF &COUNTER LE &VALUES GOTO HERE1;
-END1
)
END

Tewy
 
Posts: 123 | Location: UK | Registered: October 09, 2003Report This Post
<mhuber>
posted
Tewy,
Is it supposed to prompt for both TEST and VALUES when you run the fex?? We've had a bit of a problem with unnecessary prompts in our environment, so maybe this is another case of that.

Anyway, here's the modified code. It accepts spaces inside the string, and ignores spaces before/after the string. You can put as many or as few spaces as you want before/after the commas.

There are only a few real modifications to the original code. I also changed variable names around a bit, just to make it more intuitive.



-SET &ECHO = ALL;
-DEFAULT &INVAL = ' ';
-SET &MYWHERE = '';
-SET &MYLEN = &INVAL.LENGTH;
-SET &OUTVAR = 'A' | &MYLEN;
-SET &CTR = 1;
-SET &VARSTR ='A';
-REPEAT ENDLP WHILE &VARSTR NE ' ';
-SET &VARSTR = GETTOK(&INVAL, &MYLEN,&CTR,',X',&MYLEN,&OUTVAR.EVAL);
-SET &VAROUT = &VARSTR.LENGTH;
-SET &VARLN = '''' | 'A' | &VAROUT | '''';
-SET &VARSTR = '''' | LJUST(&VAROUT.EVAL,&VARSTR,&VARLN.EVAL) || '''';
-IF &VARSTR.EVAL EQ ' ' GOTO STOPIT;
-IF &CTR GT 1 GOTO ONEMORE;
-SET &MYWHERE = &MYWHERE | '''' | &VARSTR.EVAL || '''' | ' ';
-GOTO SKIPMORE
-ONEMORE
-SET &MYWHERE = &MYWHERE | 'OR ' | '''' | &VARSTR.EVAL || '''' | ' ';
-SKIPMORE
-TYPE &MYWHERE.EVAL
-SET &CTR = &CTR + 1;
-ENDLP
-STOPIT
-TYPE &MYWHERE
TABLE FILE CAR
PRINT CAR MODEL
BY COUNTRY
WHERE COUNTRY EQ &MYWHERE
END

I hope this helps you, Nivas.
-Michael

This message has been edited. Last edited by: <Mabel>,
 
Report This Post
Expert
posted Hide Post
have you got a published html entry page for your users to enter their parms?
if so, you could populate a drop down box, make it a multi select drop down box, and let the published page summon the drop down optionlist from a file, which you dynamically create every day (or however often your site changes).
That's what i do. My "Published" html page (using the PUBLISH thing in MRE), i copy into another empty fex. Put a filedef at the top line of the fex (a filedef to the optionlist txt file i create), and then exec the rest of the html code with
-HTMLFORM BEGIN
[HTML]
blah blah blah
select box goes here, etc
form calls focus servelt or whatever
-HTMLFORM END.

Then erase my published page, because i dont run it as an html page anymore, i run it as a fex.
I do this all over my mre sites. Let me now if this idea works for you
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 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     Multiple Parameter Values

Copyright © 1996-2020 Information Builders