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:
Any help is greatly appreciated.This message has been edited. Last edited by: Tamra,
WebFOCUS 8.0, Windows
Excel, HTML, PDF
I'm assuming that you DO have the semi-colon at the end of your define in the actual code?
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
What's the format for InputYear? Try converting InputYear to an A4 and then create the compute using that.
WebFOCUS 8206, Unix, Windows
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
WF: 184.108.40.206 > going 220.127.116.11
|Powered by Social Strata|