Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Dynamically Updated Column Names

  1. #1

    Default Dynamically Updated Column Names

    Hi, pentaho newb here,

    As a java developer, I was wondering if anyone can suggest the best way I could go about addressing this particular issue:

    - I have a database table containing the data I wish to report on
    - The column names of the table are ids (ie: 1234) which isnt really good for reporting on
    - Another database table contains the configuration (human readable name) of that column (ie: two columns in that table are <Column_ID>, <Label>)
    - I would like to create a table output with the data tables data but with the coressponding human readable name as the column name

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    We can use ETL Metadata Injection for this.
    Basically, we will create two transformations: A template containing the business logic, and a controller providing the metadata.
    Let's assume our template would have a Table Input and a Table Output step.
    In a static scenario we would rename the fields in the Table Output's field mapping.
    Since Table Output doesn't support Metadata Injection, we will use a Select Values step to do the renaming.
    Instead of providing the name mapping manually we let the controller do it at runtime.
    The central piece of the controller is an ETL Metadata Injection step accepting all the necessary input steps to learn about metadata.
    In our case a Table Input step would provide the relevant name pairs from a database.
    As soon as we saved the template we can start configuration of the Metadata Injection step by double clicking.
    We configure the template and close the step dialog pressing OK.
    When reopening the step dialog we will find the grid control populated with all the configurable items.
    We now click in the Source step cell next to FIELD_NAME and FIELD_RENAME and select the appropriate fields from the appearing dialogs.
    Refinements are left to you.
    So long, and thanks for all the fish.

  3. #3

    Default

    Quote Originally Posted by marabu View Post
    We can use ETL Metadata Injection for this.
    Basically, we will create two transformations: A template containing the business logic, and a controller providing the metadata.
    Let's assume our template would have a Table Input and a Table Output step.
    In a static scenario we would rename the fields in the Table Output's field mapping.
    Since Table Output doesn't support Metadata Injection, we will use a Select Values step to do the renaming.
    Instead of providing the name mapping manually we let the controller do it at runtime.
    The central piece of the controller is an ETL Metadata Injection step accepting all the necessary input steps to learn about metadata.
    In our case a Table Input step would provide the relevant name pairs from a database.
    As soon as we saved the template we can start configuration of the Metadata Injection step by double clicking.
    We configure the template and close the step dialog pressing OK.
    When reopening the step dialog we will find the grid control populated with all the configurable items.
    We now click in the Source step cell next to FIELD_NAME and FIELD_RENAME and select the appropriate fields from the appearing dialogs.
    Refinements are left to you.
    thanks for the reply, managed to get something working. for future reference or anyone wondering how to do it I found a helpful blog post here.

    got it outputting to .xls although it cannot output to an output table, keep getting sql 'db object does not exist' errors so its not creating/altering the output table dynamically. probably a textbook pentaho 101 issue just havent worked out how to do that yet

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.