Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: passing same parameters to multiple queries

  1. #1

    Default passing same parameters to multiple queries

    heey guys

    i have some questions about passing parameters in the report

    i have subreports and for each one i have a query

    i wana to pass the same parameters to the subreports, or to all queries

    what i made
    in query 1 :

    SELECT
    *
    FROM
    `Regions_Performance`
    WHERE
    `region_id` IS NOT null
    and `region_id` = '${Region_Number}'
    and `quarter` = '${Quarter_Number}'
    and `cur_year` = '${Year}'

    in query 2 :

    SELECT
    *
    FROM
    `Expenses_and_Revenues`
    WHERE
    `region_id` IS NOT null
    and `region_id` = '${Region_Number}'
    and `quarter` = '${Quarter_Number}'
    and `cur_year` = '${Year}'


    and so on the other queries, when i view the report from server, iam asked for 3 parameters

    the data appears on the first subreport

    but other reports are empty

    is that normal?
    did i forgot something?

    also i wana ask about "PREPARE"

    i saw it in this post

    http://wiki.pentaho.com/display/COM/...able+Solutions

    but when i tried it in the query , i wasn't asked for the parameters when executing the report from server

    and the report was empty , without data

  2. #2
    Join Date
    Jul 2009
    Posts
    19

    Default

    Has u created the paramerts of same name which u will pass to the sub report?
    Or else u can create datasource for the sub report having the SQL with paramerts ur passing to the main report and then pass that datasource.

  3. #3

    Default

    use::::
    SELECT
    *
    FROM
    `Regions_Performance`
    WHERE
    `region_id` IS NOT null
    and `region_id` = '${PREPARELATER:Region_Number}'
    and `quarter` = '${PREPARELATER:Quarter_Number}'
    and `cur_year` = '${PREPARELATER:Year}'

    in place of ::
    SELECT
    *
    FROM
    `Regions_Performance`
    WHERE
    `region_id` IS NOT null
    and `region_id` = '${Region_Number}'
    and `quarter` = '${Quarter_Number}'
    and `cur_year` = '${Year}'


    mention imported parameters in property window..
    import... Region_Number Quarter_Number Year

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.