Oracle Analytics Cloud and Server

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

Custom Filter in Analysis

Received Response
1
Views
2
Comments
Pradeep_Kumar
Pradeep_Kumar Rank 1 - Community Starter

Hi,

I am trying to create a custom-defined filter in my Analysis, which I am unable to figure out how to do it.

Let me explain this with an example for a better understanding:

I have the following table:

StudentID    StudentName        Section     Internal_Marks        External_Marks

1                    ABC                         A               20                              25

2                    BCD                         A               15                              28

3                    DEF                         B               22                              26

4                    FGH                         B               18                              24

Now I need a custom filter, which contains these 2 values to choose between "Internal_Marks" and "External_Marks".

So, whenever the user selects "Internal_Marks", then the Internal_Marks will be summed up & displayed and when "External_Marks" is selected, then the "External_Marks" are summed up and displayed.

For example, the Final Table that I need would be when I choose the custom filter:

When I select "Internal_Marks" in the created custom filter:

Section     Total_Marks

A               35

B               40

When I select "External_Marks" in the created custom filter:

Section     Total_Marks

A               53

B               50

How to create the above custom filter so that I can use it to define the Marks type to display?

Thank you!

Answers

  • Jerry Casey
    Jerry Casey Rank 6 - Analytics Lead

    One way to do this is with a variable prompt.

    Create a dashboard prompt, and select "variable".

    Give it a name like "varSelect", and a choose Radio buttons as the user input.

    Add two custom values: "Internal" and "External".

    Build your analysis with a column formula such as :

    CASE WHEN 'Internal'='@{varSelect}{Internal}' THEN "Yourtable"."Internal_Marks" ELSE "Yourtable"."External_Marks" END

  • Pradeep_Kumar
    Pradeep_Kumar Rank 1 - Community Starter

    Thank you Jerry