Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Jpivot tags howto ?

  1. #1
    Join Date
    Sep 2007
    Posts
    7

    Default Jpivot tags howto ?

    Hi there,

    I'm quite new to Mondrian/Jpivot, although I know a bit about JSP/JSTL. I have an MDX query that runs ok just modifying the example pages provides with jpivot distribution. Now I would like to add a filter to the query triggered by a combo box.

    Basically the user should chose one date in a combo box and the MDX would include a filter to the corresponding date.

    This must be really simple to do however at that point I'm totally unable to figure out how to do that, and the documentation of these interesting projetcs is somewhat scarce. This in fact is almost already done by the generic "filter box" on the demo page (accessed by clicking on the cube icon), however how can I do that with a nice combo box displaying the selected date in human-readable form, etc ?

    Any help would be greatly appreciated.

    Thanks to all,
    Christian

  2. #2

    Default

    I do this with the help of a Pentaho Action Sequence.

    I first get the date from the user via a secure filter (or alternatively, get the current date with sql or javascript), then use this as a parameter in the MDX query inside the 'Pentaho Analysis Viewer' component. In the MDX, the parameter must be enclosed in curly braces.

  3. #3
    Join Date
    Sep 2007
    Posts
    7

    Default

    Hi Roth,

    thank you very much for your prompt answer. All pieces of information will get me going a lot quicker since I'm totally new to this field (this really reminds me of my old SQL learning days, quite intereting indeed :-)

    Could you kindly post some kind of code snippet related to the method you suggest ? That'd be great.

    Thanks again,
    Christian

  4. #4

    Default

    So much for a prompt answer :-) I'm in the office only every second day, so my answers my might not always be as prompt as my last one.


    If you haven't figured it out already, here is what I suggest:

    Read the following two documents:
    http://wiki.pentaho.org/display/stud...+Design+Studio
    and
    http://wiki.pentaho.org/display/Pent...taho+Solutions

    I attached a sample action sequence which you hopefully can load in design studio (I am using an older version). It simply displays a pivot table with the date dimension always showing all, current year, current quarter, current month, days of current month up to today.
    For your purpose, you would need to add a secure filter component to display a combo box with dates. You need also a way to generate the selection of dates for your combo box. This can be anything, an SQL query, Javascript, or just a hardcoded list.

    Hope that helps,
    Tobias
    Attached Files Attached Files

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.