cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

SQL dashboard report: Select table column dynamically

pawank9
New Contributor II

I am using SQL Dashboard report, there are around 400 columns in a table, I want to display some of the columns based on data, not all 400 columns should be displayed.

eg: a table have column named c1, c2,c3,c4 and rows r1, r2, r3, r4. The report should show columns as per the below scenario,

case 1: for row r1, the report should dynamically show c1 and c2.

case 2: for row r2, the report should dynamically show c3 and c4.

case 3: for row r3, the report should dynamically show c1 and c4.

Note: consider the report is showing only one row for now.

2 REPLIES 2

Hubert-Dudek
Esteemed Contributor III

You can build own logic using query parameters, and/or just select required columns based on case.

image.png

Hi, thanks for the response.

my requirement is to select columns dynamically not the query param.

I need to select columns based on data. hope the below example provides clarity:

eg: a table have column named c1, c2,c3,c4 and rows r1, r2, r3, r4. The report should show columns as per the below scenario,

case 1: for row r1, the report should dynamically show c1 and c2.

case 2: for row r2, the report should dynamically show c3 and c4.

case 3: for row r3, the report should dynamically show c1 and c4.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group