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] Using Computes , Within and Where together

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Using Computes , Within and Where together
 Login/Join
 
Gold member
posted
Please consider the following code where I am defining the most expensive and least expensive retail cost model in each country

  
TABLE FILE CAR
SUM
	FST.MODEL WITHIN COUNTRY AS 'Most Expensive Model' 
	LST.MODEL WITHIN COUNTRY AS 'Least Expensive Model' 
BY COUNTRY 
BY MODEL 
BY HIGHEST RETAIL_COST 
END


When I try to create compute fields off the least and most expensive models, I receive the error: "Unknown error occurred. Agent on reporting server EDASERVE may have crashed or request was halted by the operator. Please investigate reporting server log. "

  
TABLE FILE CAR
SUM
	COMPUTE MEM/A50 = FST.MODEL; WITHIN COUNTRY
	COMPUTE LEM/A50 = LST.MODEL; WITHIN COUNTRY
BY COUNTRY 
BY MODEL 
BY HIGHEST RETAIL_COST 
ON TABLE PCHOLD FORMAT HTML
END


I would like to ONLY print the most and least expensive car models for each country. I know I can throw this into a hold file and rejoin the hold table back to car, but is there a cleaner solution?

I would like to be able to use "WHERE TOTAL" Model equals Most expensive or least expensive.

Does anyone know how to do this?

Thank you

This message has been edited. Last edited by: Joey Sandoval,




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Report This Post
Platinum Member
posted Hide Post
That's not going to work.

The documentation for WITHIN states:
A maximum of two WITHIN phrases can be used per display field. If one WITHIN phrase is used, it must act on a BY phrase. If two WITHIN phrases are used, the first must act on a BY phrase and the second on an ACROSS phrase.

Please refer to the old thread, which might help you.

http://forums.informationbuild...467084326#1467084326
 
Posts: 165 | Registered: September 29, 2008Report This Post
Gold member
posted Hide Post
Atturhari,

This code works. Although, I did have the "BY HIGHEST RETAIL_COST" in the wrong spot in my previous post.


 
TABLE FILE CAR
SUM
	FST.MODEL WITHIN COUNTRY AS 'Most Expensive Model' 
	LST.MODEL WITHIN COUNTRY AS 'Least Expensive Model' 
BY COUNTRY 
BY HIGHEST RETAIL_COST 
BY CAR
BY MODEL 
END 


How would you code this procedure to only show the least / most expensive car model per country?




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Report This Post
Platinum Member
posted Hide Post
Hi Joey,

How about this:

TABLE FILE CAR
SUM
FST.MODEL WITHIN COUNTRY AS 'Most Expensive Model'
LST.MODEL WITHIN COUNTRY AS 'Least Expensive Model'
BY COUNTRY
BY HIGHEST 1 RETAIL_COST NOPRINT
BY CAR NOPRINT
BY MODEL NOPRINT
END

~Jim


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Gold member
posted Hide Post
Jim, thank you. That works nicely in this example using the car file. However, I tried applying this idea to a procedure I have with our customer data, and it is just taking too long to process for some reason. I guess there is just too much data and this method is not as effecient as I thought it would be.




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Report This Post
Platinum Member
posted Hide Post
Hi Joey,

What happens if you try something like this? How many records are there in your "HLD_CAR" hold file?

TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
RETAIL_COST
ON TABLE HOLD AS HLD_CAR
END

TABLE FILE HLD_CAR
SUM
FST.MODEL WITHIN COUNTRY AS 'Most Expensive Model'
LST.MODEL WITHIN COUNTRY AS 'Least Expensive Model'
BY COUNTRY
BY HIGHEST 1 RETAIL_COST NOPRINT
BY CAR NOPRINT
BY MODEL NOPRINT
END

Let me know if this helps.
~Jim


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Platinum Member
posted Hide Post
Try
TABLE FILE CAR
SUM
FST.MODEL AS 'Most Expensive Model'
LST.MODEL AS 'Least Expensive Model'
BY COUNTRY

BY HIGHEST RETAIL_COST
END
 
Posts: 140 | Location: Adelaide South Australia | Registered: October 27, 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     [SOLVED] Using Computes , Within and Where together

Copyright © 1996-2020 Information Builders