Focal Point
( Closed ) Choose between 2 variable input

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4827024766

February 20, 2014, 02:55 PM
YKK
( Closed ) Choose between 2 variable input
Hello. I have a simple question but a big puzzle for me

I have a file with the following fields

A01C36 which hold item code
A02C36 which hold length
A03C36 which hold color

I would like the user to search by item only or length or color
or length and color or any combination

Is there a simple way without using others than web focus

Thank you in advance

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


7.6. / Win 7 / Excel
February 20, 2014, 03:28 PM
Francis Mariani
You must have a parameter screen. Add three check boxes for each of the fields. In the WebFOCUS report, you can easily build the WHERE statement using Dialog Manager code to base it on which check boxes were selected.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 20, 2014, 03:58 PM
YKK
Sorry, I explain wrong

A01C36 hold all the item codes
A02C36 hold all the different lengths
A03C36 hold all the different colors

I want users to be able to enter 18.00 in the length prompt and get all the items of 18 inches

or enter 18.00 in the length prompt and 501 in the color prompt and get all the items of 18 inches 501 items

If one of the prompt box is empty, I get all records with empty


7.6. / Win 7 / Excel
February 20, 2014, 04:39 PM
Mighty Max
What does your table request look like?
Can you make a sample using the CAR file?
Does this code help you?
  
-DEFAULT &A01C36 = ''
-DEFAULT &A02C36 = '18'
-DEFAULT &A03C36 = '501'

-SET &ITEM_CODE = IF &A01C36 EQ '' THEN 'FOC_NONE' ELSE &A01C36;
-SET &LENGTH = IF &A02C36 EQ '' THEN 'FOC_NONE' ELSE &A02C36;
-SET &COLOR = IF &A03C36 EQ '' THEN 'FOC_NONE' ELSE &A02C36;

TABLE FILE DATA_SRC
PRINT 
   COL_1
   COL_2
   COL_3

WHERE A01C36 EQ '&ITEM_CODE';
WHERE A02C36 EQ '&LENGTH';
WHERE A03C36 EQ '&COLOR';
END
-RUN



WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
February 21, 2014, 02:58 AM
Dave
or...
...if you don't like using _FOC_NONE.

-PROMPT &ITEMCODE.Item code.;
-PROMPT &ITEMLENGTH.Length.;
-PROMPT &ITEMCOLOR.Color.;

-SET &WHERE_CODE = IF &ITEMCODE EQ '' OR ' ' THEN '' ELSE 'WHERE A01C36 EQ &ITEMCODE.EVAL;';

-SET &WHERE_LENGTH = IF &ITEMLENGTH EQ '' OR ' ' THEN '' ELSE 'WHERE A02C36 EQ &ITEMLENGTH.EVAL;';

-SET &WHERE_COLOR = IF &ITEMCOLOR EQ '' OR ' ' THEN '' ELSE 'WHERE A03C36 EQ &ITEMCOLOR.EVAL;';

TABLE FILE a_file
PRINT A01C36 A02C36 A03C36
&WHERE_CODE
&WHERE_LENGTH
&WHERE_COLOR
END


Goodluck


_____________________
WF: 8.0.0.9 > going 8.2.0.5
February 21, 2014, 07:49 AM
RSquared
quote:
or...
-PROMPT &ITEMCODE.Item code.;
-PROMPT &ITEMLENGTH.Length.;
-PROMPT &ITEMCOLOR.Color.;

TABLE FILE a_file
PRINT A01C36 A02C36 A03C36
-IF &ITEMCODE EQ '' OR ' ' GOTO GETNEXT;
WHERE A01C36 EQ &ITEMCODE;
-GETNEXT
-IF &ITEMLENGTH EQ '' OR ' ' GOTO GETNEXT1;
WHERE A02C36 EQ &ITEMLENGTH;
-GETNEXT1
-IF &ITEMCOLOR EQ '' OR ' ' GOTO GETEND;
WHERE A03C36 EQ &ITEMCOLOR;
-GETEND
END


&WHERE_COLOR
END



WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
February 25, 2014, 03:21 PM
YKK
Thank you all for your help, Mighty Max solution is working for me and I will use it to complete my report, then I will try Dave and RSquare solutions ( May use them in another report )

Again Thank you all


7.6. / Win 7 / Excel