Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Creating array from database columns

  1. #1
    Join Date
    Aug 2009

    Default Creating array from database columns


    I am about to create my first report and would really like to use the sparkline feature. I as have read in thte documentation it expects an array or a csv input.

    However in one of the use cases I'd like to do there are many and changing number of rows in the resultset so creating subqueries as discussed in this blog is out of the question.

    So is there any way I can transform a rowset like this:

    into an array in order to use it as sparkline input?

    thanks and regards

  2. #2
    Join Date
    Aug 2009

    Default still looking

    I've been looking for a solution in the meantime. Am i missing something obvious?

  3. #3
    Join Date
    Jun 2007


    I use sparklines, I create a stored procedure to create a text string of those values.

    The documentation says it can take an array if the database supports it, but I had no luck passing an array.

    I use Postgres, you may want to mention what database you are using.

  4. #4
    Join Date
    Aug 2009

    Default database

    We use postgres too, so no group_concat unfortunately.

    By the way does anyboda know what the Raw Data Field do when creating a sparkline expression.
    Can this field used to feed input?

  5. #5

    Default Any luck?

    I was just wondering if you ever found a solution to this? I have a normal dataset and I would like to add a sparkline in my group header. It seems as though all that needs to happen is to take each value of the group and add it to an array, which I would use for my sparkline. I would have expected there to be a function for this, but I can't seem to find one!

    Any help would be appreciated

    - Dan

  6. #6
    Join Date
    Aug 2010


    I've been using the suggestion off this page to do this in postgres:

    basically you create a single column dataset and pass that to the ARRAY function, then pass that result to the array_to_string function.
    SELECT array_to_string(ARRAY(SELECT value FROM mytable))

    Something like that..

Tags for this Thread

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 - 2017 Pentaho Corporation. All Rights Reserved.