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]populate one order or whole list of order.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved]populate one order or whole list of order.
 Login/Join
 
Gold member
posted
I need to create a report based on the status of the user. If this user is internal person, then the output will be the whole list of order. If this user is a client (or outside user), only the client's order will be output. Do you have any suggestion?

Thanks

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


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 60 | Registered: March 02, 2015Report This Post
Virtuoso
posted Hide Post
Do you have a way to identify from where the user come from (internal/external) ?

You first need to know that then easy to assign a variable based on that such as :
-SET &CLTFILTR = IF &INTERNALUSR EQ 'Y' THEN FOC_NONE ELSE &CLIENTNO;

TABLE FILE ORDERS
...
WHERE CLIENTNO EQ &CLIENTNO;
END


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
I do have a separate master files that identify user status. Do I need to create another fex to get the &clientno and include this fex?

Thank you for your help


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 60 | Registered: March 02, 2015Report This Post
Virtuoso
posted Hide Post
I would say no (you can add the code in the same fex) but without knowing all the situation, configuration and model difficult to say exactly what to do.

If the user status is in another file, to retrieve its status you probably already have (as in a parameter) the user/client number.
So use that client/user parameter to retrieve its status then apply something similar as I already suggested to test if it's an inner or outside client and set the filter.

1- use client/user parameter to retrieve its status.
2- assign filter parameter according to status.
3- perform your report using above filter.

Sample:
-* WILL RETURN ONLY TRIUMPH
-*-SET &CAR = 'TRIUMPH';
-* WILL RETURN EVERYTHING
-SET &CAR = 'DATSUN';

TABLE FILE CAR
PRINT BODYTYPE
WHERE CAR EQ '&CAR';
ON TABLE SAVE AS DTYP FORMAT ALPHA
END
-RUN
-READ DTYP &BODYTYPE.A12.
-RUN

-SET &FILTR = IF &BODYTYPE EQ 'HARDTOP' THEN &CAR ELSE FOC_NONE;

TABLE FILE CAR
PRINT CAR
      MODEL
      BODYTYPE
BY COUNTRY
WHERE CAR EQ '&FILTR';
END
-RUN

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
Just a thought: How about a JOIN and a DEFINE?

JOIN (to your file that contains the 'user status')
DEFINE FILE CAR
FILTR = IF &BODYTYPE EQ 'HARDTOP' THEN &CAR ELSE FOC_NONE;
END
TABLE FILE CAR 
PRINT CAR MODEL BODYTYPE 
BY COUNTRY
WHERE CAR EQ FILTR
END
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Gold member
posted Hide Post
Thank you, Martin.

I tried your method and it works for Car.mas. However when I tried on my master data. For some reason, the &INSTNAME from -READ has extra characters such as '000003' before the actual value of this field. Here is my code before I can build the second half.

-SET &ECHO=ALL;
TABLE FILE INSTITUTIONLIST
PRINT
INSTNAME
WHERE LOGINID EQ '&FOCSECUSER';
ON TABLE NOTOTAL
ON TABLE HOLD AS InstList FORMAT ALPHA
ON TABLE SET STYLE *
$
ENDSTYLE
END
-RUN
? HOLD InstList
-READ InstList &INSTNAME.A100.
-RUN
-SET &FILTER= IF &INSTNAME EQ 'All' THEN FOC_NONE ELSE &INSTNAME;

The return of -SET is like this

-SET &FILTER= IF 000003All EQ 'All' THEN FOC_NONE ELSE 000003All

Any thoughts?

Thanks


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 60 | Registered: March 02, 2015Report This Post
Virtuoso
posted Hide Post
it's a question of FOCLIST which is added to FOCUS files.

Instead try:
TABLE FILE INSTITUTIONLIST
PRINT INSTNAME
BY LOGINID NOPRINT
WHERE LOGINID EQ '&FOCSECUSER';
ON TABLE HOLD AS InstList FORMAT BINARY
END
-RUN
? HOLD InstList
-READFILE InstList
-RUN
-SET &FILTER= IF &INSTNAME EQ 'All' THEN FOC_NONE ELSE &INSTNAME;

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
I tried this but when I run it, INSTNAME become a drop down box.

-SET &ECHO=ALL;
TABLE FILE INSTITUTIONLIST
PRINT
INSTNAME
BY LOGINID NOPRINT
WHERE LOGINID EQ '&FOCSECUSER';
ON TABLE NOTOTAL
ON TABLE HOLD AS InstList FORMAT BINARY

END
-RUN
? HOLD InstList
-READFILE InstList
-RUN
-SET &FILTER= IF &INSTNAME EQ 'All' THEN FOC_NONE ELSE &INSTNAME;


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 60 | Registered: March 02, 2015Report This Post
Virtuoso
posted Hide Post
I don't understand why it become a DropBox.
You may have something else somewhere.

Are you running from the Content or ReportingServer ?

Try this from Console:

-DEFAULT &CNTRY = 'FRANCE';

-SET &ECHO=ALL;
SET ASNAMES = ON
TABLE FILE CAR
PRINT MODEL AS 'INSTNAME'
BY COUNTRY NOPRINT
WHERE COUNTRY EQ '&CNTRY';
ON TABLE HOLD AS InstList FORMAT BINARY
END
-RUN
? HOLD InstList
-READFILE InstList 
-RUN
-SET &FILTER= IF &INSTNAME EQ 'All' THEN FOC_NONE ELSE &INSTNAME;
-TYPE &FILTER


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
1. The 00003 is because it's a VARCHAR, re-define it as Alpha
2. Need to initialize &INSTANCE to "", AND, any other &VARIABLE that needs to be read in, at least, that's what we're having to on 8.1.04...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Gold member
posted Hide Post
I initialize the &variable and it works. Thank you. Music


WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 60 | Registered: March 02, 2015Report 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]populate one order or whole list of order.

Copyright © 1996-2020 Information Builders