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] Filter on ACROSS field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Filter on ACROSS field
 Login/Join
 
Platinum Member
posted
Hello

I have a TABLE request in this format.
  
TABLE FILE CAR
SUM
   CAR_SALES
   SUV_SALES
ACROSS COUNTRY
END


Assuming COUNTRY has USA, ENGLAND and BRAZIL...I am trying the eliminate the records CAR_SALES value is 0 when COUNTRY is BRAZIL.

How would I do this?

I have 3 different HOLD files for above 3 countries and I used MORE to merge them
Please suggest

Thanks.

This message has been edited. Last edited by: <Kathryn Henning>,


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
 
Posts: 139 | Registered: July 21, 2011Report This Post
Gold member
posted Hide Post
Try this, where "car" is your merged file:

DEFINE FILE CAR
MY_RETAIL_COST /D7 = IF (COUNTRY EQ 'FRANCE') THEN 0 ELSE RETAIL_COST;
END
TABLE FILE CAR
SUM
DEALER_COST
MY_RETAIL_COST
ACROSS
COUNTRY

WHERE NOT (COUNTRY EQ 'FRANCE' AND MY_RETAIL_COST EQ 0)

ON TABLE SET PAGE-NUM OFF
END
-RUN


Without the WHERE statemet the country FRANCE with MY_RETAIL_COST 0 (zero) is shown.


WebFOCUS 7.6, 7.7
Windows, All Output formats
 
Posts: 90 | Location: Stuttgart | Registered: October 20, 2010Report This Post
Virtuoso
posted Hide Post
BI,

If I understand correctly, you would like to delete a COLUMN where the value is 0.
This is not possible when you are SUMming 2 columns.
Here is a solution where you are converting 2 columns to 1, after which a condition a the column makes the 0 values disappear:
  
DEFINE FILE CAR
RETAIL_COST = IF COUNTRY EQ 'FRANCE' THEN 0 ELSE RETAIL_COST;
DEALER_COST = IF COUNTRY EQ 'JAPAN' THEN 0 ELSE DEALER_COST;
V1/I1 WITH COUNTRY=1;
V2/I1 WITH COUNTRY=2;
END
TABLE FILE CAR
SUM
V1 RETAIL_COST
V2 DEALER_COST
BY COUNTRY
ON TABLE SAVE AS BI 
END
-RUN
EX -LINES 7 EDAPUT MASTER,BI,C,MEM
FILENAME=BI      , SUFFIX=FIX 
 SEGMENT=BI, SEGTYPE=S0 
 FIELDNAME=COUNTRY, ALIAS=E01, USAGE=A10, ACTUAL=A10, $
 SEGMENT=CO, PARENT=BI, OCCURS=VARIABLE,$
 FIELDNAME=V, ALIAS=E02, USAGE=I1, ACTUAL=A01, $
 FIELDNAME=COST, ALIAS=E03, USAGE=D7, ACTUAL=A07, $
-RUN
DEFINE FILE BI
COSTNAME/A6=DECODE V(1 'RETAIL' 2 'DEALER');
END
TABLE FILE BI
SUM COST
ACROSS COUNTRY
ACROSS COSTNAME AS ''
IF COST NE 0
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report 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] Filter on ACROSS field

Copyright © 1996-2020 Information Builders