BIP RTF formula? division and math formula — Oracle Analytics

Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

BIP RTF formula? division and math formula

Received Response
101
Views
1
Comments

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

Tagged:

Answers

  • John Bruso1
    John Bruso1 Rank 6 - Analytics Lead

    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?>