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] PROMPT SORT ORDER

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] PROMPT SORT ORDER
 Login/Join
 
Gold member
posted
I'm wondering it it's possible to get the values that display with a descending sort instead of an ascending sort in a prompt like the &CHOOSE_DATE prompt in the CAR file example below.

-* File date_prompt_car.fex
APP HOLD IBISAMP
TABLEF FILE GGSALES
BY HIGHEST DATE
ON TABLE NOTOTAL
ON TABLE HOLD AS CAR_DATE_LIST FORMAT FOCUS
ON TABLE SET HTMLCSS ON
END
-RUN
-SET &&CAR_DATE = &CHOOSE_DATE.(OR(FIND DATE IN CAR_DATE_LIST)).Choose Date.;
-TYPE &&CAR_DATE

This message has been edited. Last edited by: Kerry,
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Virtuoso
posted Hide Post
Did you try by LOWEST?


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Gold member
posted Hide Post
I did, but it does not seem to make any difference. No matter what, the prompt displays the dates starting with 1996/01/01, 1996/02/01, counting up to 1997/12/01.

What I want is to start with 1997/12/01 and count down to 1996/01/01.

I also tried putting LOWEST here:

-SET &&CAR_DATE = &CHOOSE_DATE.(OR(FIND HIGHEST DATE IN CAR_DATE_LIST)).Choose Date.;

but that results in no values at all in the prompt.
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Expert
posted Hide Post
Joan,

My belief is that the code you have (without HIGHEST or LOWEST) is the only acceptable code for that use. I think that you will find that the Autoprompt JavaScript uses a similar method to that employed within launch pages to obtain field values for use within the select control with a "sourcetype" attribute of "typeMaster".

For example, using your posted code - OR(FIND DATE IN CAR_DATE_LIST) - firstly we know that it's a multiple select control, and therefore the control will be given the attribute "multiple".

From the rest of the code piece we can determine that the MAS is CAR_DATE_LIST and the Fieldname is DATE. Therefore the code used to return the object array used to populate the control would be -
TABLE FILE CAR_DATE_LIST
SUM FST.DATE
BY DATE
ON TABLE PCHOLD FORMAT XML
END

If you included the HIGHEST in your code you will understand that it will be interpreted as a fieldname. As that doesn't exist in your MAS then the XML returned would be empty and therefore you will have no options shown in your select control.

I think (please correct me someone if I am wrong) that there, currently, is no way you can effect the order you desire. You could try an NFR but your best method (imho) would be to control everything yourself and build your own launch page instead of relying upon amper autoprompting.

It is what I do most of the time for the very reason you have encountered. I actually have a frameset split into two sections (as per autoprompt page) with the left hand frame being populated by the bespoke launch page. For select controls with special sorting requirements, I use a "sourcetype" attribute of "typeFex" and control the sorting myself.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Scratch that, I have been playing Smiler

Looking at the code that is executed to derive the options for the select control, there are four parameters passed known internally to the JS being accessed as file, field, pre and where. Now for the amper autoprompting the last two are set to null and therefore not accessible. The code that is run for the option list is -
SET LINES=5000
SET PAGE=NOPAGE
SET HOLDLIST=PRINTONLY
SET XMLTYPE=DISPLAY
TABLE FILE [file]
BY [field]
ON TABLE PCHOLD FORMAT XML
END

So I got to thinking that providing the Field value is interpreted as a single group of words or token, the process should work if you used -
-SET &DUMMY = &CHOOSE_DATE.(FIND 'HIGHEST DATE' IN GGSALES).Choose Date.;

and it does!

So there's your answer. If you want HIGHEST or LOWEST sort order, just include it with the field name in single quotes.

And there's more. You can even code 'HIGHEST 10 [fieldname]' to control the number of options.

T

This message has been edited. Last edited by: Tony A,



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
Joan

Maybe the double ampersand is the reason of your problem?

-SET &&CAR_DATE = &CHOOSE_DATE.(OR(FIND HIGHEST DATE IN CAR_DATE_LIST)).Choose Date.;





Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Gold member
posted Hide Post
Tony,
Thanks so much. That is the coolest thing. And it works! You are my hero.
Joan
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Gold member
posted Hide Post
Frank,
Thanks for your idea. Turns out the && will still work with Tony's fix. This is cool because I will be able to make an "all purpose" prompt to use with -INCLUDE that passes the variable chosen by the prompt! Hooray.
Joan
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Gold member
posted Hide Post
Frank / Tony,

Cancel that post to Frank - When I run the following and make a selection, the selection does not show up in the variable:

FEX:
-* File date_prompt_car.fex
APP HOLD IBISAMP
TABLEF FILE GGSALES
BY DATE
ON TABLE NOTOTAL
ON TABLE HOLD AS CAR_DATE_LIST FORMAT FOCUS
ON TABLE SET HTMLCSS ON
END
-RUN
-SET &CAR_DATE = &CHOOSE_DATE.(OR(FIND 'HIGHEST DATE' IN CAR_DATE_LIST)).Choose Date.;
-TYPE &CAR_DATE

SELECTION:
1996/01/01

RESULT:
-INCLUDE date_prompt_car.fex
-* File date_prompt_car.fex
APP HOLD IBISAMP
TABLEF FILE GGSALES
BY DATE
ON TABLE NOTOTAL
ON TABLE HOLD AS CAR_DATE_LIST FORMAT FOCUS
ON TABLE SET HTMLCSS ON
END
-RUN
1
0 NUMBER OF RECORDS IN TABLE= 4317 LINES= 4194
0
-SET &CAR_DATE = ;
-TYPE
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Master
posted Hide Post
Joan,

The difference between && and & is that && creates a GLOBAL variable while & creates a LOCAL variable. A global variable will remain active as long as your session remains active. A local variable remains active as long as your program (.fex) remains active. If you are using autoprompt a && may not prompt you for input on a second (or subsequent) run.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Gold member
posted Hide Post
Pat,
I do like that there is an && option. I was hoping to use just that feature to save me from having to repeat code like that in my example in multiple fexes.

I'm hoping someone has an answer now for my problem with actually returning a value using the 'HIGHEST fieldname' as described by Tony.

In my testing, the && does not seem to make a difference. And I do not want the variable prompted more than once. I do want the value to be passed from the -INCLUDEd fex to the calling fex.

Anyone have ideas about the missing values with the 'HIGHEST fieldname'?

Joan
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Virtuoso
posted Hide Post
In the web world, there is less of a difference now between && and &. In each case, there is a completely new connection made on subsequent runs so even if && was resolved the first time you ran the code, when you run it again, it connects in a new sessions, and && would need to be resolved again.

My rule of thumb would be that there are very few times when you would need to use an && variable in a WF report. In my thousands of pragrams I've coded, I can on think of maybe a couple where it was used. Anyone have any ideas as to when an && variable SHOULD be used in a WF report?


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Gold member
posted Hide Post
Sorry all, but PLEASE CAN WE MAKE THIS POST NOT ABOUT && VS &????
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Expert
posted Hide Post
Joan,

The one question that I would ask you is to explain to yourself how your process would run.

Bear in mind that the parser will scan your code looking for unresolved variables (only single &) and as necessary build the autoprompting frameset.

When you have made a selection for your variables your code will be parsed with the DM being executed first before the TABLE requests etc.

You will understand, therefore, that the autoprompting will occur before your code to build the temporary table from which your date selection is to be gleaned. In short, your master and data files need to exist before you even run your fex. Using the code you posted, this will not be the case.

Your solution is to do what Susannah does all the time (but has not told us of late Wink) and perform all your extract files for lookups, compare lists etc. overnight so that they exist when you need them.

Good luck

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Oh, and the real reason that &CAR_DATE is not populated? That's not the variable you are prompting for - it's actually &CHOOSE_DATE.

Replace -TYPE &CAR_DATE with -TYPE &CHOOSE_DATE to see what I mean.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
Tony,
I was hopeful, but I'm afraid I'm still not there. Even if I do the line table in a different fex (which I plan to do), the problem is still not resolved. (I put all the code on one for demo purposes.)

Version A Fex:
-* File date_prompt_car.fex
-SET &&CAR_DATE = &CHOOSE_DATE.(OR(FIND DATE IN CAR_DATE_LIST)).Choose Date.;
-RUN
-TYPE &CHOOSE_DATE
-TYPE &&CAR_DATE

Version A Results:
-INCLUDE date_prompt_car.fex
-* File date_prompt_car.fex
-SET &&CAR_DATE = 19960101;
-RUN
-TYPE 19960101
19960101
-TYPE 19960101
19960101

Version B Fex:
-* File date_prompt_car.fex
-SET &&CAR_DATE = &CHOOSE_DATE.(OR(FIND 'HIGHEST DATE' IN CAR_DATE_LIST)).Choose Date.;
-RUN
-TYPE &CHOOSE_DATE
-TYPE &&CAR_DATE

Version B Result:
-INCLUDE date_prompt_car.fex
-* File date_prompt_car.fex
-SET &&CAR_DATE = ;
-RUN
-TYPE
-TYPE

Note in the Version B Result that the -SET line has no value, while in Version A Result the -Set line displays the evaluated value.

Joan
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Virtuoso
posted Hide Post
quote:
TABLEF FILE GGSALES
BY HIGHEST DATE
ON TABLE NOTOTAL
ON TABLE HOLD AS CAR_DATE_LIST FORMAT FOCUS
ON TABLE SET HTMLCSS ON
END

You need to use TABLE (not TABLEF).


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
Sorry. That was a typo.

It still does not work.

Please assume the following.

I am creating CAR_DATE_LIST in a separate focexec.

I want to resolve problems with sort order and passing variables as described elsewhere in this thread.
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Expert
posted Hide Post
Joan,

I've been looking at the underlying JS and the XML that is produced as a result of the OR(etc. etc. and cannot identify why the variable(s) are not being returned.

It's nothing to do with the single quotes around the 'HIGHEST DATE' as using 'DATE' works OK.

I'll try an ascertain why the problem exists when I get more time, but for now it looks like this won't work as much as we would like it too Frowner

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
Version A works - that's great!
Version B will not work, because there is no field called 'HIGHEST DATE' in the master file.
As far as I know you can't use sorting commands in the FIND statement, just fields that exist in the master file.

Hope this helps ...


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
Gamp,

If you enclose HIGHEST DATE in single quotes within the code then the dropdown list is populated OK. It's just that the variable value is not passed on form submission. My thought is that it is dropped in the creation of the &QUERY_STRING value but haven't had time to prove / disprove.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
Gamp,
I wonder if you can try this code out. It does actually display a prompt with the values on my system. (WF 7.1.6)

If you're right about sorting, I guess I'll have to see if they would put this into a request for a new release. When there are 36 months or more of data, users notice when they have to scroll through that many months to get to the current month.

joan
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Gold member
posted Hide Post
Tony,
Thanks so much for your interest in this. I was wondering if somehow an EVAL would help, but couldn't find where to put it.
Joan
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Gold member
posted Hide Post
Tony / All,

I found out that this works if I take out the (OR...).

Focexec:

-SET &CAR_DATE = &CHOOSE_DATE.(FIND 'HIGHEST DATE' IN CAR_DATE_LIST).Choose Date.;
-TYPE &CAR_DATE

Result:
-INCLUDE date_prompt_car.fex
-* File date_prompt_car.fex
-SET &CAR_DATE = 19971201;
-TYPE 19971201
19971201

So as long as there is no need for more than one month of data, I have what I need. That happens to be the case for my immediate need.

I do think there may be a need for more than one month, however, so if there is a way to make the (OR...) work that would be even better. Maybe this gives us a clue about what's happening?

Joan
 
Posts: 64 | Location: Denver | Registered: July 20, 2005Report This Post
Member
posted Hide Post
I'm using this technique in our current version to get a descending list of dates and it works fine. We're planning to upgrade to 7.6.9 and it seems to ignore the find command and just displays a text box. Have they changed the behavior or could there be something else I have to do in 7.6.9 to make this work?

At this point I'm thinking I'll have to create a launch page to get this funtionality, but any assistance making it work with autoprompt would be greatly appreciated.


7.6.9
Windows XP SP3
Primarily HTML & PDF
 
Posts: 2 | Registered: February 09, 2009Report This Post
Expert
posted Hide Post
For anything fancy, I highly recommend a launch page. Autoprompt is for testing and quick and dirty.

Another way to get the list sorted is to use a program to populate the box in a launch page.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Member
posted Hide Post
In this paricular case, I have a set of very simple reports with just the single date prompt. I was hoping to get away with using autoprompt, but it appears a launch page is inevitable.

Our company is fairly new to WF. Is it common for undocumented things like this to stop working in a new version?


7.6.9
Windows XP SP3
Primarily HTML & PDF
 
Posts: 2 | Registered: February 09, 2009Report This Post
Expert
posted Hide Post
Code gets tightened and if the code construct you are using doesn't match the syntax in the manual, you are bound to get bitten.

You can create a very simple launch page in minutes with the HTML Composer.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report 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] PROMPT SORT ORDER

Copyright © 1996-2020 Information Builders