How can I avoid denominator should not get filtered while calculating the percentage in beast mode

Options

Hi,

I have a column name 'Order' with 1 to 6 values in it. I need to calculate the percentage of order 1 and show this percentage on a card in the dashboard. This percentage should change dynamically when the data gets refreshed.

I am taking unique count of orders having 1 divide by total count of orders. when i am filtering in analyzer with order 1, it gets filtering both numerator and denominator counts and i am getting 100% rather than actual percentage.

How this issue can be resolved, could you please suggest.

Thank you.

Best Answers

  • david_cunningham
    Answer ✓
    Options

    @SwapnaE you can use FIXED functions to achieve this in your denominator.

    Say your filter column is called ColumnB, and you want to allow a date column (DATE) to filter

    COUNT(ColumnB) FIXED (FILTER ALLOW DATE))

    You can set which columns are allowed to impact the denominator.

    This will prevent all columns except for what you allow from impacting your denominator.

    Here is a good reference article you can use to dial in the exact set up you need for your particular requirements.

    David Cunningham

    ** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
    ** Did this solve your problem? Accept it as a solution! ✔️**

  • david_cunningham
    Answer ✓
    Options

    @SwapnaE you can use COUNT DISTINCT with a fixed function.

    To not allow any filters, you would do something like this.

    COUNT(DISTINCT `id`) FIXED (FILTER NONE)
    

    David Cunningham

    ** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
    ** Did this solve your problem? Accept it as a solution! ✔️**

Answers

  • david_cunningham
    Answer ✓
    Options

    @SwapnaE you can use FIXED functions to achieve this in your denominator.

    Say your filter column is called ColumnB, and you want to allow a date column (DATE) to filter

    COUNT(ColumnB) FIXED (FILTER ALLOW DATE))

    You can set which columns are allowed to impact the denominator.

    This will prevent all columns except for what you allow from impacting your denominator.

    Here is a good reference article you can use to dial in the exact set up you need for your particular requirements.

    David Cunningham

    ** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
    ** Did this solve your problem? Accept it as a solution! ✔️**

  • DataMaven
    Options

    I'd like to staple this answer to my brain!

    DataMaven
    Breaking Down Silos - Building Bridges
    **Say "Thanks" by clicking a reaction in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
  • SwapnaE
    SwapnaE Member
    Options

    Thank you David.

    Can I use COUNT(DISTINCT ORDERID) with FIXED function and I do not want to allow any filter for the denominator.

  • david_cunningham
    Answer ✓
    Options

    @SwapnaE you can use COUNT DISTINCT with a fixed function.

    To not allow any filters, you would do something like this.

    COUNT(DISTINCT `id`) FIXED (FILTER NONE)
    

    David Cunningham

    ** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
    ** Did this solve your problem? Accept it as a solution! ✔️**

  • SwapnaE
    SwapnaE Member
    Options

    @david_cunningham, Thank you so much. My issue got resolved with your suggestion.