Pentaho

 View Only

 Transpose tables in Pentaho CDE

  • Pentaho
  • Pentaho
Oleg Zemnukhov's profile image
Oleg Zemnukhov posted 04-26-2019 14:48

Hello.

I create a dashboard in pentaho cde.

it is necessary to make a transposed table in which the number of columns will dynamically change depending on the results of the data set.

it is possible to do with standard tools, using the "table component" for example.

Or should I develop  а "custom javascript"?


#Pentaho
Paulo Pires's profile image
Paulo Pires

Hi Oleg,

Yes it's doable, you would need to specify the table properties in the Pre Execution function (columns, headers, etc).

And since the query didn't run yet in the Pre Execution of the Table Component, probably use a query component to fetch the data with a higher priority to run before the Table Component, so you know how many columns would go to the table.

By default CDA cache is enabled and will store the results of the query, so the Table Component would read the data from CDA cache and not run the query a second time.

Eduardo de Lima's profile image
Eduardo de Lima
This is archivable by using a Kettle datasource (Kettle over KettleTransform File) 
The columns and data that will populate the table will change depending on the resultset sent by the transformation. 
As for the aesthethics , you can manually set the name of each column in the transformations . The table style can also be modified with CSS and pre-execution functions . 
I did this some time ago. The user wanted to see data on the table based on a selection in a drop box, depending on what he selected , the table would have 3 columns or even 12 columns. 
The table listen to a Simple Parameter that is fired after selection and triggers the transformation that will populate the table. Hope this works for you.