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] Selective WHERE

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Selective WHERE
 Login/Join
 
Gold member
posted
In the sample code below, I want the YTDSALES field to disregard the WHERE selection for MONTH EQ '08' i.e. I want the WHERE MONTH EQ '08' to apply to the MTDSALES and BUDGETSALES fields but for YTDSALES field, I want it to add up values WHERE MONTH LE '08' or disregard the MONTH EQ '08' statement all together. Any suggestions on how this can be achieved?


TABLE FILE SALES
SUM
MTDSALES
YTDSALES
BUDGETSALES
BY REGION
BY COSTCENTER
WHERE COSTCENTER EQ 'ABC'
WHERE MONTH EQ '08'
END

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


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
 
Posts: 69 | Registered: March 11, 2010Report This Post
Expert
posted Hide Post
Pretty simple. I would assume(probably incorrectly) that you are "NOT" hard-coding the Month, so I will assume it is another ampere variable, along with a Year(maybe?):

TABLE FILE SALES
SUM
  COMPUTE XMTDSALES/P13.2MC    = IF YEAR EQ '&YEAR' AND MONTH EQ '&MONTH' THEN MTDSALES    ELSE 0; AS 'MTDSALES'
  COMPUTE XYTDSALES/P13.2MC    = IF YEAR EQ '&YEAR' AND MONTH LE '&MONTH' THEN YTDSALES    ELSE 0; AS 'YTDSALES'
  COMPUTE XBUDGETSALES/P13.2MC = IF YEAR EQ '&YEAR' AND MONTH EQ '&MONTH' THEN BUDGETSALES ELSE 0; AS 'BUDGETSALES'
  COMPUTE FLAG/A1              = IF XMTDSALES EQ 0 AND XYTDSALES EQ 0 AND XBUDGETSALES EQ 0 THEN 'N' ELSE 'Y'; NOPRINT
BY REGION
BY COSTCENTER
WHERE COSTCENTER EQ 'ABC';
WHERE TOTAL FLAG EQ 'Y';
-* WHERE MONTH EQ '08'

END


WHERE statements end with a semi-colon, though, until IBI does some code-tightening, it will work without one.


hth

Tom


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
Yes, I am using amper variables. This should work. Thanks!


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
 
Posts: 69 | Registered: March 11, 2010Report 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] Selective WHERE

Copyright © 1996-2020 Information Builders