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
April 01, 2016, 09:33 AM
George Patton
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.