Oracle Analytics Cloud and Server

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

How to add dynamic column name from data in table in OAC

Accepted answer
379
Views
13
Comments

I have date-related data and a requirement for a table with columns like city, month1, month2, and so forth. These month column names should dynamically reflect the data, adjusting automatically if there are changes in the date filter.

Is there a feature that can handle this requirement?

Best Answer

  • Hi @User_TUWA3 ,

    The number of columns in a visualisation/analysis is static, you can't change it dynamically.

    I'd transform your data unpivoting the month columns, in order to have only 2 columns: month name and month value. Then you can use a Pivot visualisation to achieve your goal.

«1

Answers

  • BalagurunathanBagavathy-Oracle
    BalagurunathanBagavathy-Oracle Rank 6 - Analytics Lead

    @User_TUWA3

    I suggest you to use IndexCol function. Please refer https://docs.oracle.com/en/cloud/paas/analytics-cloud/acubi/indexcol-function.html

    I hope it helps.

    Regards,
    Bala.

  • Hi @User_TUWA3 ,

    Do you need to automatically select different columns based on your filters, or only adjust column names?

    Are you using Classic Analytics or Data Visualization?

    I would use presentation variables (in Classic Analytitcs) or parameters (Data Visualization) to store the selected values in filters. Then create one or more calculated columns with a CASE statement based on presentation variables/parameters to dynamically select the date columns to display. If you only need to change the column names, then it's sufficient to use presentation variables/parameters directly in the column headers/titles.

  • Rashmi Jadhav-Oracle
    Rashmi Jadhav-Oracle Rank 4 - Community Specialist
    edited June 2024

    @Federico Venturin, I want to show the month columns automatically based on the filter, let's say filter start date was 1st april and end date 26th June, then the table visual should show column name as below

    city| april 2024 | may 2024 | june 2024

    I am using Data Visualization

  • Rashmi Jadhav-Oracle
    Rashmi Jadhav-Oracle Rank 4 - Community Specialist

    @BalagurunathanBagavathy-Oracle , I tried your approach but it adds the values to the row and does not change the column name.

  • Rashmi Jadhav-Oracle
    Rashmi Jadhav-Oracle Rank 4 - Community Specialist

    @Federico Venturin , Can you assist me in figuring out how to create a calculation that dynamically sets the column name? The approach I tried only added months to rows and didn't change the column names.

    Thanks,
    Rashmi

  • Hi @User_TUWA3 ,

    Do you know in advance how many month columns to display? Does it depend on the filters?

    e.g. when start date is 1st April and end date 26th May which month columns do you need to display? april 2024 and may 2024? or june 2024 as well?

  • Rashmi Jadhav-Oracle
    Rashmi Jadhav-Oracle Rank 4 - Community Specialist

    @Federico Venturin , Yes it will be depended on the filter. For example, in the scenario you described, the columns should only display April 2024 and May 2024, which are selected in the filter.

  • BalagurunathanBagavathy-Oracle
    BalagurunathanBagavathy-Oracle Rank 6 - Analytics Lead

    @User_TUWA3

    Can you check if the article below helps you?
    BIEE 12C - How To Change Column Header Value Dynamically (Doc ID 2604814.1)

  • Rashmi Jadhav-Oracle
    Rashmi Jadhav-Oracle Rank 4 - Community Specialist

    @Federico Venturin ,If I can't make it dynamic, I'm considering using the city names from the data as static column names in the table. Could you assist me in creating those column names?