Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 15 Oracle Analytics Lounge
- 208 Oracle Analytics News
- 41 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 76 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
BIP RTF formula? division and math formula

Content
I'm trying to get a formula to work within an RTF template and this isn't working:
((sum(current-group()/PRIOR_EXP) + sum(current-group()/CURRENT_EXP)) div sum(current-group()/Budget)) * 100
The division piece seems to be failing but I don't know why:
(sum(current-group()/PRIOR_EXP) + sum(current-group()/CURRENT_EXP)) div sum(current-group()/Budget)
Moving the math to the query is not an easy option. I'd like to do this in the BIP RTF if possible.
Thanks,
John
Answers
-
I was able to solve this by using variables and making sure the data type on my field didn't change to Regular text from Number.
<?xdoxslt:set_variable($_XDOCTX, 'a', sum(current-group()/PRIOR_EXP) + sum(current-group()/CURRENT_EXP))?>
<?xdoxslt:set_variable($_XDOCTX, 'b', sum(current-group()/BUDGET))?>
<?choose:?><?when: sum(current-group()/BUDGET)=0?>0<?end when?><?when: sum(current-group()/BUDGET)>0?><?xdoxslt: get_variable($_XDOCTX, ’a’) div xdoxslt:get_variable($_XDOCTX, ’b’)?><?end when?><?otherwise:?>0<?end otherwise?><?end choose?>0