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
392
Views
13
Comments
2»

Answers

  • a requirement for a table with columns like city, month1, month2, and so forth.

    If you want a table with a dynamic number of columns, then use a pivot. and your data shouldn't physically be stored in multiple column but by rows (for example with a single "date" column saying what date the value is for).

    If you display that date column in a pivot, you can make it render more or less columns by filtering the number of dates/periods/months to display in your pivot.

    But all this is just theory because there aren't info about what your data source is like etc.

  • Rank 3 - Community Apprentice

    If you are using Classic Dashboards, expand on what others have said about setting a presentation variable in the dashboard prompt. This is the starting point of the idea.

    Create a standard prompt that the users will see, using it to filter your data.

    Create a second prompt control which will use that same column and set X number of other ones - one for each displayed column where you want to dynamically change the label, such as pvMonth1, pvMonth2, … for 'Jan 2024', 'Feb 2024', or similar, based on the selection chosen by the user. You will need a separate table to drive these values. In my example, I uploaded a spreadsheet into DV as a dataset:

    Set the first column as the same column that the users see in their prompt on the dashboard. In my example, the user's prompt contains a single column based on Quarter Name.

    On this second prompt, configure each other column to use SQL Results for both LOV and default selection. In my example, I set Quarter Name to presentation variable pvQtrVar. I then used this variable in all the other SQL statements in the WHERE clause.

    Once repeated for all column names, add this prompt in on the dashboard properties > Filters and Variables. It will be completely hidden from the user, but will set variables when the user interacts with the one on the dashboard, as it also uses Quarter Name for the user to select.

    On the analysis, customize the column header to use these month variables, such as:

    I only coded 2 columns in this example, but here is the final result:

  • edited Jun 28, 2024 8:37AM

    @Dori S.-Oracle Rashmi already said that it's DV. Not Classic. We love all the increased participation but please let's keep the forum focused. Information can be spread out over many posts. We shouldn't post replies just based on the original post without context. Thank you.

Welcome!

It looks like you're new here. Sign in or register to get started.