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     [CLOSED] Computed Field Issue
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Computed Field Issue
 Login/Join
 
Member
posted
Hi.
One of our users is having issues getting a virtual field to work correctly in InfoAssist. It seems to be correct on the surface, and our in-house IBI developer (15+ years experience) believes it should work, but it's not.

This is the "code":
IF ( InputYear LT 2013 ) THEN ( 0.052 * RevenueTotal ) ELSE
IF ( InputYear EQ 2013 ) THEN ( 0.051 * RevenueTotal ) ELSE
IF ( InputYear EQ 2014 ) THEN ( 0.051 * RevenueTotal ) ELSE
IF ( InputYear GT 2014 ) THEN ( 0.056 * RevenueTotal ) ELSE 0

To be clear, the fields used (InputYear and RevenueTotal are also virtual fields. The return is applying the 0.056 math to all years regardless of how we set up the statements...with and without the parens, etc.

These are the results... as you can see the math is wrong on the Administrative Expense for all years except 2015:

2009
Revenue Total
$18,706,352

Administrative Expense
$1,047,556


2010
Revenue Total
$22,570,546

Administrative Expense
$1,263,951


2011
Revenue Total
$26,278,346

Administrative Expense
$1,471,587


2012
Revenue Total
$32,619,378

Administrative Expense
$1,826,685


2013
Revenue Total
$34,495,318

Administrative Expense
$1,931,738


2014
Revenue Total
$39,521,818

Administrative Expense
$2,213,222


2015
Revenue Total
$44,029,503

Administrative Expense
$2,465,652
**************************************
Any help is greatly appreciated.

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


WebFOCUS 8.0, Windows
Excel, HTML, PDF
 
Posts: 11 | Registered: December 15, 2015Reply With QuoteReport This Post
Master
posted Hide Post
I'm assuming that you DO have the semi-colon at the end of your define in the actual code?

How about:

IF InputYear EQ 2013 OR 2014 THEN 0.051 * RevenueTotal ELSE
IF  InputYear LT 2013  THEN  0.052 * RevenueTotal 
ELSE  0.056 * RevenueTotal;


I'm not a fan of unnecessary brackets, but they shouldn't make any difference here I don't think.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
What's the format for InputYear? Try converting InputYear to an A4 and then create the compute using that.


WebFOCUS 8206, Unix, Windows
 
Posts: 1673 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Master
posted Hide Post
Sue,

are these COMPUTEs or DEFINEs?

If they are COMPUTEs the "InputYear" is multiplied by the number of lines in your dataset. Just like "SUM InputYear".

You might want to

IF ( FST.InputYear ...  ..) THEN .. ELSE


G'luck.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 669 | Location: Veghel, The Netherlands | Registered: February 16, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Computed Field Issue

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