2 Replies Latest reply: Apr 23, 2013 5:38 PM by switbeck RSS

    Items and Buttons

    switbeck
      I am having trouble understanding how items and buttons work. I am able to create an item, such as a shuttle, but it doesn't do anything. Say for instance I had a chart defined by this SQL statement:

      select
      null link,
      cust_last_name label,
      round(sum(order_total/total.tot),
      2) value -- determine percentage of all orders
      from
      demo_orders,
      demo_customers,
      (select
      sum(order_total)tot
      from
      demo_orders) total -- sum all orders
      where
      demo_orders.customer_id = demo_customers.customer_id
      group by
      cust_last_name


      And I wanted to add a shuttle to list which customers are included in the chart. I mainly don't understand how to link items to buttons or actions.

      Thanks,
      Steve
        • 1. Re: Items and Buttons
          n_shah18
          you need to pass the value of your shuttle item to the query and a action is required , you can use a submit button.
          select
          null link,
          cust_last_name label,
          round(sum(order_total/total.tot),
          2) value -- determine percentage of all orders 
          from
          demo_orders,
          demo_customers,
          (select
          sum(order_total)tot 
          from
          demo_orders) total -- sum all orders 
          where
          demo_orders.customer_id = demo_customers.customer_id 
          and demo_customers.customer_id =:P_X --- this would be you shuttle item
          group by
          cust_last_name
          • 2. Re: Items and Buttons
            switbeck
            Here is my query for my shuttle.

            select

            cust_last_name label,
            round(sum(order_total/total.tot),
            2) value -- determine percentage of all orders
            from
            demo_orders,
            demo_customers,
            (select
            sum(order_total)tot
            from
            demo_orders) total -- sum all orders
            where
            demo_orders.customer_id = demo_customers.customer_id
            group by
            cust_last_name

            For some reason it wouldn't let me select just the customer name even though thats the only thing that I want to filter by. Oddly enough when this query is used for the shuttle, the only thing that shows up in the shuttle is the customer last names. Also in the query you posted, would I want the additional statement you added in the WHERE clause to be referring to the customer id or the cust_last_name?