Business Unit prompt not working when TopN is applied in OTBI — Oracle Analytics

Oracle Transactional Business Intelligence

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

Business Unit prompt not working when TopN is applied in OTBI

Accepted answer
11
Views
1
Comments

Hi All

I have a margin analysis where I added Business Unit as a prompt so the user can switch between BUs.

But when I apply a TopN filter, the Business Unit prompt is not responding — it automatically selects the default BU and I’m not able to choose any other BU from the prompt.

Has anyone faced this issue or know how to fix it?

Best Answer

  • Riyaz Ali-Oracle
    Riyaz Ali-Oracle Rank 6 - Analytics Lead
    Answer ✓

    Hi @skhan,

    The problem arises because the TopN filter is applied before the prompt value is processed, causing the report to default to a specific Business Unit and ignore user selections.

    Try the below:
    1. Use a Presentation Variable in the Filter:

    Instead of hardcoding the TopN filter, use a presentation variable tied to the Business Unit prompt:
    sql
    FILTER("Revenue"."Amount" USING "Business Unit"."Name" = '@{P_BU}')
    Then apply the TopN logic within a pivot or table view, not directly in the analysis filter.

    2. Apply TopN in the View, Not in the Criteria:

    Remove the TopN filter from the Criteria tab.
    In the Table or Pivot View, go to Edit Table Properties → Data Sorting → Row Count and set the TopN there.
    This allows the prompt to apply first, and the TopN to be evaluated afterward.

    3. Use a Subquery or Filtered Analysis:

    Create a filtered analysis that uses the prompt value and returns only the relevant Business Unit data.
    Then apply TopN logic in a second analysis or dashboard section.

    Thanks,
    Riyaz Ali