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] Setting Default value of a prompted variable from another variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Setting Default value of a prompted variable from another variable
 Login/Join
 
Gold member
posted
Hi,

I am trying to set a default value for date amper variable in my report. I have to show a default date in the variable prompt screen. This date I am extracting from querying a table and saving in another variable.

Now trying
-DEFAULT &TODAY=&SAVEDATE

Its taking &SAVEDATE as value for &TODAY. I tried &SAVEDATE.EVAL also but no luck.

Can somebody please guide.

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


7.6.11
Linux
Excel, HTML, PDF

 
Posts: 69 | Registered: February 15, 2008Report This Post
Virtuoso
posted Hide Post
And yet it has to be .EVAL.
Please run the following code:
-SET &TST = 'TEST';
-DEFAULT &TST1 = &TST
-DEFAULT &TST2 = &TST.EVAL
-TYPE &TST &TST1 &TST2
The output I get is:
 TEST &TST TEST
as I would expect it to be, thereby illustrating that .EVAL indeed should do the trick.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Gold member
posted Hide Post
Hi GamP,

Thanks for your response. I tried similar thing but didn't get the desired output. Please see my code below
FILEDEF TDATE DISK &APPROOT/baseapp/bustoday.txt
TABLE FILE table1
PRINT
EDW_PARAMETER_VALUE AS ' '
WHERE PARAMETER_ITEM EQ 'AS_AT_BUSINESS_DATE';
ON TABLE SAVE AS TDATE FORMAT COM
END
-RUN
-READ TDATE &TDAY.A20.
-SET &TODAY=EDIT(&TDAY,'$99999999$');
-SET &TODAY=EDIT(&TODAY,'$$$$$$99')||'/'||EDIT(&TODAY,'$$$$99$$')||'/'||EDIT(&TODAY,'9999$$$$');
-DEFAULT &FROM_D = &TODAY.EVAL
-TYPE &FROM_D;
  


But still I am getting &TODAY.EVAL

Can you see what is wrong with this code?

Regards,
Chirag


7.6.11
Linux
Excel, HTML, PDF

 
Posts: 69 | Registered: February 15, 2008Report This Post
Virtuoso
posted Hide Post
I agree with GamP that .EVAL should work. But why not avoid that step altogether?

.
.
-READ TDATE &TDAY.A20.
-SET &TODAY=EDIT(&TDAY,'$99999999$');
-SET &FROM_D=EDIT(&TODAY,'$$$$$$99')||'/'||EDIT(&TODAY,'$$$$99$$')||'/'||EDIT(&TODAY,'9999$$$$');
-TYPE &FROM_D


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
I have to give user facility to give value to &FROM_D from Auto prompting screen. But the screen is populating &TODAY.EVAL not the right value.

Regards,
Chirag


7.6.11
Linux
Excel, HTML, PDF

 
Posts: 69 | Registered: February 15, 2008Report This Post
Virtuoso
posted Hide Post
Ah, the magic word - AutoPrompt.
You're just not going to be able to do this when you're using autoprompt.
After all autoprompt DOES NOT execute the code, it just SCANS for possibly unresolved &var's. Each -DEFAULT is a possibly unresolved parameter, so it is placed on the autoprompt screen with - yes indeed - whatever is to the right side of the equation, taken literally. The only solution to this - as I can think of - is to build the html selection screen without using autoprompt.
But maybe someone else has a better idea?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
as Gamp says, build yourself a regular launch page, rather than have the user use an autoprompt page.
then default the value &from_d with &today.eval
in a text box and let the user override.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Gold member
posted Hide Post
Thanks Susannah and Gamp for the useful inputs. I have created a launch page to input the parameter and it's taking the default value from &from_d.
The issue is resolved.

I would like to improve the basic launch page created here. Can you please refer me to launch page documentation link.

Thanks again.

Regards,
Chirag


7.6.11
Linux
Excel, HTML, PDF

 
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] Setting Default value of a prompted variable from another variable

Copyright © 1996-2020 Information Builders