Oracle Analytics Cloud and Server

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

Filter part of column values based on another column

Accepted answer
41
Views
1
Comments
ashraf817
ashraf817 Rank 3 - Community Apprentice

Hello everyone,

I'm new to the data field and would appreciate some guidance on an issue I'm facing.

I have a column named "Service Type" with three values: "Paid Consultation," "Free Consultation," and "Service," and "Service Description" column.

I need to filter the "Service Description" column to display only the top 10 values where the "Service Type" is "Service," while keeping everything else in the column as it is.

Any ideas on how I can do this?

i use oracle analytics desktop

Thank you!

Tagged:

Best Answer

  • Gianni Ceresa
    edited August 2024 Answer ✓

    Hi,

    You could use the TOPN function and apply it by "Service Type", because only 'Service' has more than 10, the other values of "Service Type" will always shows all the "Service Description".

    Something like RANK(Total by Service Type) < 11if you want it as explicit filter.

    You can also look at TOPN, which will do something similar:TOPN(Total, 10 by Service Type)

    If you really want to do the TOP10 only on 'Service', then you can combine the 2 conditions: Service Type <> 'Service' OR RANK(…) < 11