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] A way to return how many values a auser Multi Selects

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] A way to return how many values a auser Multi Selects
 Login/Join
 
Master
posted
I am not even sure how to ask this but here goes..

We have an HTML form.

STEP1 - The user selects a time frame and data is retrieved for the entire company...ALL departments by department. This takes up to 2 minutes after which a message appears saying: 'Data Loaded'

STEP2 - The user then hits a 'Report' button that calls an HTML page where they may Multi- Select any combination of Departments. A report is run against the hold file created in Step1 for only those Departments chosen. Data is immediately returned. The user may repeat this over and over for any single department or combinations having data retrieval almost instantaneous since it lives in the hold file.

Its worked well for years.

Without getting into specifics we have a request that will cause one of the reported columns on the report to be calculated one way if ONLY 1 department is chosen and another way if more than one is chosen.

So, we need some sort of IF THEN ELSE logic in the fex that evaluates how may Departments the user has chosen on the html form.

(I am not making this up!)

Thoughts? I need a creative way to do this without recreating the thing from scratch - its rather involved.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Master
posted Hide Post
I guess the easiest ( and most certain ) way is to pre-query it.

TABLE FILE PRE_GENERATED_HOLD_FILE
 BY DEPARTMENT
ON TABLE HOLD DEPARTMENT_COUNTER
END
-RUN
-SET &NUMBER_OF_DEPARTMENTS = &LINES;


Then you can use &NUMBER_OF_DEPARTMENTS to switch between one and the other version of calculating your stuff ;-)

G'luck!


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Virtuoso
posted Hide Post
If, and only if, your parameter comes in as an "array", the number of items in the array is in the 0th element of the array.

An array arrives from a drilldown as:
&DEPARTMENT0=3;
&DEPARTMENT='Finance';
&DEPARTMENT2='Sales';
&DEPARTMENT3='Marketing';


Normally, if you define a parameter to be multi-select, it arrives as:
&DEPARTMENT='''Finance'' OR ''Sales'' OR ''Marketing''';


In a drilldown you can pass an array like this:[code]
TYPE=DATA, COLUMN=DEPARTMENT, FOCEXEC=nextFex(
DEPARTMENT='Finance'
DEPARTMENT='Sales'
DEPARTMENT='Marketing'
),$[\code]

You can use and populate arrays in loops, for example to create above drilldown dynamically:[code]
TYPE=DATA, COLUMN=DEPARTMENT, FOCEXEC=nextFex(
DEPARTMENT=&DEPARTMENT.QUOTEDSTRING
-REPEAT :NEXTDEP FOR &D FROM 2 TO &DEPARTMENT0;
DEPARTMENT=&DEPARTMENT.&D.QUOTEDSTRING
-:NEXTDEP
),$[\code]


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Master
posted Hide Post
Generally I would do things the way Dave suggested. Its fast and you know right away how many will return data.

If you needed to do this on the HTML side of things, you could write a function in JS to cycle through the values of the Multi-Select element and count how many are selected. You can then pass that as an input variable as well.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Platinum Member
posted Hide Post
RobertF, is your fex receiving a var with value that would look something like this:
 
'Dept1' OR 'Dept2' OR 'Dept3'
 


Do you only need to distinguish between 1 value or many values? Or do you really need the count of the department values?
-DEFAULTH &Depts= '''DEPT1''';
-DEFAULTH &Depts= '''DEPT1'' OR ''DEPT2'' OR ''DEPT3'' OR ''DEPT4''';

-TYPE &Depts 

-* One or many logic:
-SET &Dept_many = IF POSITION(''' OR ''',&Depts) THEN 'Many' ELSE 'One';
-TYPE Dept_many = &Dept_many

-* Count of depts. logic
-SET &Depts2 = STRREP (&Depts.LENGTH, &Depts, 6, ''' OR ''', 5, ''' | ''', &Depts.LENGTH, A&Depts.LENGTH );
-SET &Depts2 = TRUNCATE(&Depts2);
-SET &Depts_count = &Depts.LENGTH - &Depts2.LENGTH + 1;
-TYPE Depts_count = &Depts_count

  

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


WebFOCUS 8.2.06
 
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010Report This Post
Master
posted Hide Post
Got It...Thanks!


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report 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] A way to return how many values a auser Multi Selects

Copyright © 1996-2020 Information Builders