Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Using the IN FILE option
Go
New
Search
Notify
Tools
Reply
  
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, 2004Reply With QuoteReport 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: 1969 | Location: Centennial, CO | Registered: January 31, 2006Reply With QuoteReport 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, 2005Reply With QuoteReport 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, 2005Reply With QuoteReport 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, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

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

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.