Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: CDE Selectors, Queries, and Parameters. Looking for help

  1. #1
    Join Date
    Jan 2018
    Posts
    3

    Default CDE Selectors, Queries, and Parameters. Looking for help

    Hi everyone.
    I'm new to Pentaho (working with it for about 4 weeks now) and I'm getting hung up while trying to get a selector to filter by an ID in a column.
    My client wants to be able to have the entire report be visible but to then be able to narrow down the results by certain IDs in different columns. My goal right now is to have a Selector populated with the IDs of the column then when an ID is selected, store it in a parameter and use that parameter in the database query. ex: WHERE DEPARTMENT.DID=${selectedID}

    I'm using a sql over sqljndi query and all the documentation and forum posts I find are all for MDX queries and I just can't seem to fumble my through it yet.

    I created a simple parameter just to try and get the query working with hard coded params. I get data if I put 47 in the query it's self but get nothing when trying to use the parameter. Heres how its setup:
    Simple Parameter
    Name: DID_Param
    Property value: 47
    Bookmarkable: False
    Public: False (also tried True)

    sql over sqljndi
    Name: tableQuery
    Access Level: Public
    Jndi: ########
    Query: **** AND DEPARTMENT_INFO.DID=${DID_Param} **** works when set equal to 47 (test#)
    Parameters: DID_Param | DID_Param | Integer
    Calculated Columns: []
    Columns: []
    Output Columns: []
    Output Mode: Include
    Cache Keys: []
    Cache Duration: 3600
    Cache: True

    Like I said, I'm very new to this so I'll take all criticisms and tips.

    I'm wondering if my problem is stemming from the parameter possibly being a string and not an integer.
    Hope you folks can help.
    Thank you

  2. #2
    Join Date
    Aug 2016
    Posts
    140

    Default

    In the query options try setting the parameter to type string

    Any parameters I have used, whether the value is a string or integer, has always worked with the parameter set as a string

  3. #3
    Join Date
    Jan 2018
    Posts
    3

    Default

    Deanicus - Thanks for the reply. I finally figured out what was wrong. I didn't realize you needed to have the parameter in the component as well, and that solved my problem. I had the parameter and was passing the parameter to the database right, just didn't have it listed in the component. I did notice too that it doesn't seem to matter what the type is set to, it worked either way.

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.