Oracle Analytics Forum

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

I'm trying to use a formula that results in a percentage, but instead i'm getting a integer number

Received Response
41
Views
2
Comments
User_HQ9TE
User_HQ9TE Rank 4 - Community Specialist

Hello Oracle Community

This is the formula, that I'm using,

(Count (Value A)/ (Value B))*100.0

The selected column is the final result of that formula:

But, the result is wrong, because this should be right result:


(5/970)*100.0=0

Actually result is 0.515

So, the result is wrong, can you help me in this problem?


Best Regards,

Answers

  • EzequielC-Oracle
    EzequielC-Oracle Rank 6 - Analytics & AI Lead

    Hi @User_HQ9TE

    Welcome to the Oracle Analytics Community!

    To enhance your experience and foster meaningful interactions, we encourage you to personalize your profile by setting up a display name and uploading a profile picture. Your display name will be how others recognize and engage with you in discussions, while a profile picture adds a personal touch to your forum presence.

    Take a moment to update your profile with a display name and an image representing you. Let's create a vibrant and engaging community together!


    Regarding your question, if you change the column data format to show 2 or 4 decimals, does it show the correct value?

    Regards,

    Ezequiel.

  • [Deleted User]
    [Deleted User] Rank 0 - Community Observer

    Hello nameless user,

    The "* 100.0" has no influence whatsoever since it only applies to the result of your division. I.e. you're too late in the mathematical execution chain. Divisions involving integers work as follows:

    image.png

    Meaning that if your 2 columns A and B are integers a mathematical 1 / 3 will yield 0 and multiplying that by 100.0 will yield 0.0.

    Your starting columns must not be integer before the division happens. Mathematical execution precedence.