1

I am using petaho report desiner

My main query is

select create_date  , sum(product_uos_qty) from sale_order_line group
by create_date

It is running properly

and sub query is

SELECT column_name
FROM information_schema.columns
WHERE table_schema='public' 
 AND table_name='sale_order_line' 
 AND (column_name = 'product_uos_qty' OR column_name ='price_unit')

output of this query is

product_uos_qty
price_unit

I create a parameter select

and convert main query into this

select create_date  , sum(${select}) from sale_order_line group by create_date

but it is not running it gives following error

ERROR: The query 'main' did not execute successfully. The reason given was: 'org.pentaho.reporting.engine.classic.core.ReportDataFactoryException: Failed at query: select create_date , sum(${select}) from sale_order_line group by create_date'

tell me what is the main problem and how i can solve it

Lukasz Szozda
  • 162,964
  • 23
  • 234
  • 275
  • do you need both `product_uos_qty,price_unit` column in the sub select or what ? – Vivek S. Apr 25 '15 at 11:20
  • ya i need both but need one at a time on selection base –  Apr 25 '15 at 11:21
  • side note: does this `select create_date , sum(product_uos_qty),sum(price_unit) from sale_order_line group by create_date` approach cant be use ? – Vivek S. Apr 25 '15 at 11:23
  • I think It can give the access both product_uos_qty and price_unit at the same time –  Apr 25 '15 at 11:25
  • 1
    Need Clarifucation : why you're uisng this `SELECT column_name FROM information_schema.columns WHERE table_schema='public' AND table_name='sale_order_line' and (column_name = 'product_uos_qty' or column_name ='price_unit')` ?, you can give the column name directly right? – Vivek S. Apr 25 '15 at 11:30
  • yes right , but if i give column name directly that will not work in drop down section in pentaho subquery . so i use this query which output is input as a main query –  Apr 25 '15 at 11:39

0 Answers0