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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Using the IN FILE option

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using the IN FILE option
 Login/Join
 
Platinum Member
posted
I have a need to use two IN FILE filters in one fex. FOCUS does not allow this, does anyone know a work around?
FILEDEF EUROPE DISK C:\ibi\apps\TEMPFILE\EUROPE.ftm
FILEDEF ASIA DISK C:\ibi\apps\TEMPFILE\ASIA.ftm
DEFINE FILE CAR
ITEM7/D12.2 = IF COUNTRY IN FILE EUROPE THEN SALES ELSE 0;
ITEM8/D12.2 = IF COUNTRY IN FILE ASIA THEN SALES ELSE 0;
END
TABLE FILE CAR
SUM ITEM7 ITEM8
END


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
Expert
posted Hide Post
Spence, FOCUS/WebFOCUS does allow this:

DEFINE FILE CAR
SEL1/I1 = DECODE COUNTRY(ASIA ELSE 1);
SEL2/I1 = DECODE COUNTRY(EUROPE ELSE 1);
ITEM7/D12.2 = IF SEL2 EQ 0 THEN SALES ELSE 0;
ITEM8/D12.2 = IF SEL1 EQ 0 THEN SALES ELSE 0;
END
TABLE FILE CAR
SUM ITEM7 ITEM8
END


Use the DDNAME in the DECODE...Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
This is what I'd do:

Change the contents of the selection files to have single quotes around each value and each value ending with a comma (I am assuming you're generating these files in previous TABLE commands):

Europe:
'ENGLAND',
'ITALY',

Asia:
'JAPAN',
'KOREA',

Then use the files as fexes in -INCLUDE statements. Change the DEFINE IF statements, the INCLUDEs will pull in the files as values in the IN('a','b','c') statement. Because the files are generated with a TABLE they will most likely have a comma on the last value, that's why the '' is there before the closing ) of the IN statment.
-SET &ECHO=ALL;
FILEDEF EUROPE DISK C:\IBI\APPS\TEMP\EUROPE.FTM
FILEDEF ASIA DISK C:\IBI\APPS\TEMP\ASIA.FTM
-RUN
DEFINE FILE CAR
ITEM7/D10 = IF COUNTRY IN (
-INCLUDE EUROPE
'') THEN SALES ELSE 0;
ITEM8/D10 = IF COUNTRY IN (
-INCLUDE ASIA
'') THEN SALES ELSE 0;
END
TABLE FILE CAR
SUM
SALES
ITEM7
ITEM8
BY COUNTRY
END


With ECHO=ALL, the program looks like this:
FILEDEF EUROPE DISK C:\IBI\APPS\TEMP\EUROPE.FTM
FILEDEF ASIA DISK C:\IBI\APPS\TEMP\ASIA.FTM
-RUN
DEFINE FILE CAR
ITEM7/D10 = IF COUNTRY IN (
'ENGLAND',
'ITALY',
'') THEN SALES ELSE 0;
ITEM8/D10 = IF COUNTRY IN (
'JAPAN',
'KOREA',
'') THEN SALES ELSE 0;
END
TABLE FILE CAR
SUM
SALES
ITEM7
ITEM8
BY COUNTRY
END


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Tom, that's certainly easier!


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Tom and Francis thanks for the responses.

Tom, the decode works great. Thanks for your help.

ds


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report 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     Using the IN FILE option

Copyright © 1996-2020 Information Builders