Mondrian in Action Update

It’s hard to believe it’s been almost a year since we announced that a book on Mondrian was in the works.  But were finally getting to the point where it feels like it’s almost finished.  We are getting ready to go into the final series of chapter reviews (11 total).  

It’s still going to be a few more months as we finish up the appendices and indexes and update based on reviews and then the production guys make it look nice and finished.  We also know that by the time the book is published some pretty big things are likely to have happened in the Mondrian technology sphere, like 4.0 actually being released and Pentaho 5.0 hopefully being released as well.  But that’s the drawback to technical books. (It gives me interesting stuff to blog about.)

On the whole, I’m very happy with what we’ve put together.  We’ve managed to put a lot of information into the book.  So much so that we’re now looking for ways to trim back to get within our allotted page count.  This book will be a great one to give to anyone who wants to learn about Mondrian and doesn’t want to visit a whole bunch of different sites and blogs.  I hope you enjoy it and find it useful.

 


Mondrian in Action Discount!

What’s better than getting an early release copy of Mondrian in Action?  How about getting it for 1/2 off!  All the same Mondrian goodness by for only half the price.  Just hop over to the Manning site and and use the discount code dotd1101au.

Hurry, though.  This code is only good on November 1st from 12am to 11:59pm EDT.

And while you’re at it, go see what Julian Hyde, author of Mondrian and co-author of Mondrian in Action has to say.

Remember – 50% off November 1st only with code dotd1101au.


Mondrian in Action – Early Access Edition Now Available

It’s official!  Mondrian in Action is now available as an Early Access Edition from Manning press.  You can order it on the book’s manning page and the first three chapters are available.  I can tell you that about half of the others are really close as well.

So why should you order an early release version of the book?  Here are a few reasons why I think it’s a good idea.
First, if you are new to business analytics, the first three chapters are available and provide a great overview of what Mondrian is and how it can be used.
Second, you don’t have to wait until next spring to get all of the details on Mondrian 4.  You can already download the software from GitHub, so why not get the book that goes with it as it’s written.  There are a number of big changes coming to Mondrian 4 that make is better and different than previous versions.
Finally, and I think most importantly, you will be able to influence the book and make it great.  The authors all know Mondrian, so we naturally think we are doing a great job of explaining it.  But you might disagree and can offer ways to explain it better.  There is an author’s forum that we will be monitoring regularly that allow you to interact with us about the book.  Our ideal is that people will read the book, apply the techniques we describe and give us feedback before the presses start rolling.
In the end Mondrian in Action is only successful if it helps you, the reader.  And we’d really like to get your feedback to make sure that happens.

Getting session variables when using the PRD scriptable data source

In a previous post I was asked in the comments how to use a session variable as a parameter when using the scriptable data source in Pentaho Report Designer.  I finally figured it out and thought I’d share with everyone. The solution is relevant for scriptable data sources, not just those that use MongoDB, so I’ll leave that complexity out of this discussion.

Pre-conditions

Before this will work you need to have some way you are getting a session variable set that you want to use.  You can create an action sequence that runs when a user logs in or, if you are using single sign-on, you can set it during the log in process that way.  These are describe other places, so I won’t go into how to set the session variable.  For the sake of this example, lets assume you have somehow set a session variable for a user called “Region” that has the region that applies to the user, North, South, East, or West.

Create a Report Parameter

The first thing to do is to create a report parameter that will get the session value.  Then set the Name and Value Type as appropriate.  The key step is to set the Default Value Formula to =ENV(“session:Region”). The ENV function will get the session value for the attribute with the name “Region”.  You should also set the parameter to be Hidden by checking the box, although while testing it can be handy to have it unchecked.  Note that if you preview in report designer this will have no value (there are ways to set it), so a default value can be handy.  I don’t recommend deploying to production with a valid default, though.

The following figure shows getting the Region value from the session.

Image

Using the Parameter

Using the parameter from your script is simple.  The scriptable interface provides a dataRow object with a .get(String name) command to get the value.  So, to get the value of Region at run time use the following line (in Groovy):

def region = dataRow.get(“Region”)

Then just use the value in the script.


Using a Textbox Parameter for Multi-Value Selections in Pentaho Report Designer

Pentaho Report Designer allows you to create parameters that users can use to filter the data.  Usually this is done by providing buttons or lists or other standard UI types to select the values.  However, there are times when the list of possible values is quite long, making a selection list to long to be feasible.  In these cases it would be ideal to provide a simple text box and then enter the list of matching values to use.  Unfortunately a text box is associated with a single value and not a list.  But not to fear, there is a straightforward solution using a hidden parameter and a post-processing formula.

Lets say you want to look at information from an HR database that contains 1000 employees with dozens of records each an you only want the information for a few employees.  So you create a report with the query:
 
select * from employees where employee_id in (${empid});
You then create a parameter called empid with a text box and type of string and run the report.  Typing in 1002, 1005, 1007 you only get data back on the employee with number 1002.
To fix this problem, create a second parameter that we’ll call empid_array.  This parameter has a type of Object and a Post-Processing Formula of =CSVARRAY([empid];0;”,”;).  Check the box that makes the parameter hidden so that it won’t show up on forms.
This formula says to convert the parameter named empid to an array using a comma as a separator and don’t quote.
Now modify your query to use the empid_array parameter:
 
select * from employees where employee_id in (${empid_array});
Now run your report and enter 1002, 1005, 1007 and you should see all records for all of the employees.

Follow

Get every new post delivered to your Inbox.

Join 294 other followers