Oracle Analytics Cloud and Server

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

Dynamic Column Heading based on Column Values

Received Response
104
Views
11
Comments
Sishiho Makoto
Sishiho Makoto Rank 3 - Community Apprentice

Good Day Experts,

Is there a way to dynamically rename column heading based on a specific field value?

The scenario I have is like this:

If <TYPE> = 'value1' THEN column_heading_name equal to 'Units'

If <TYPE> = 'value2' THEN column_heading_name equal to 'Quantity'

Let me know if you need further details.

Thank you.

«1

Answers

  • Joel
    Joel Rank 8 - Analytics Strategist

    What exactly do you want to achieve? I'm not sure if I understand what you're trying to do here. What would happen if you have  both values returned in your data set? Or are you creating 2 columns from this column based on the CASE statement that you provided?

  • Sishiho Makoto
    Sishiho Makoto Rank 3 - Community Apprentice

    Hello Joel Acha,

    I am only using 1 column for this.

    I have a requirement that the column header name of this attribute should change to:

         1. 'Units' if column_type = 'Units' or

         2. 'Quantity' if column_type = 'Quantity'.

    Thank you for your reply.

  • Joel
    Joel Rank 8 - Analytics Strategist

    The point I tried to make earlier is what if you return data that has not values in that column? What would be the heading in that instance?

  • Sishiho Makoto
    Sishiho Makoto Rank 3 - Community Apprentice

    Hello,

    It will always have values (column_type) in that column since it is a required column.

    Thank you.

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    I just have to ask / say this out loud for the sake of my own mental sanity:

    Does whoever designed that "data model" beneath have any idea of how databases work in the first place?!

    Such a "requirement" is at the same time hilarious and makes one lose faith in mankind at the same time.

  • Sishiho Makoto
    Sishiho Makoto Rank 3 - Community Apprentice

    Hello Sir Christian,

    Thank you for your input sir.

    May I request please to kindly confirm if this requirement is feasible to do in analysis report (dynamic column heading base on a specific value)?

    Thank you again.

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    In order to "solve" this "requirement" you'd need to be more specific. Is the value of column A driving the header column B? Or is the value of column A driving the header of column A?

    If the latter...How can you be certain that only 1 value is ever present?

    While technically doable, this is pretty counter-intuitive and dirty with regards to any development standard. Let alone "analytics" as a concept in and of itself.

  • Sishiho Makoto
    Sishiho Makoto Rank 3 - Community Apprentice

    Hello Sir Christian,

    The value of columnA is the one who will dictate what would be the column header name of columnB.

    Wherein columnA will be put in the 'Section' part in the pivot table:

    Also attaching the report layout I want to achieve.

    Expected Layout.jpg

    Thank you very much.

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    Use BIP or Excel. What you're doing isn't analytics. It's pixel-perfect reporting.

  • Sishiho Makoto
    Sishiho Makoto Rank 3 - Community Apprentice

    Hello Sir Christian,

    Thank you for your input.

    Yes I am more of a BI Publisher guy and it can be done using that tool.