Showing posts with label presentation. Show all posts
Showing posts with label presentation. Show all posts

Tuesday, August 13, 2013

Conditional Formatting of Calculated Items in OBIEE 11g

By Victor Fagundo

Calculated items in OBIEE Pivot tables can be very useful in certain reporting circumstances, either for ease of development, or to meet specific report requirements. While calculated items in OBIEE are easy, and flexible, they do have one important drawback: they take on the data and display formatting of the fact column they are calculated against.

The most common case is the calculation of a % change across a time dimension in financial reporting ( Year over Year, Quarter over Quarter, etc.). 1   This type of calculation usually takes the form of a percent change calculation similar to below:

 (( $2 - $1 ) / $1) *100 

By default, if you perform this calculation against a numerical fact ( sales, customers) you will run into the problem of how to display the % change in the correct format, since the calculated % will want to take the form of the fact it is calculated against, as can be seen in the example 2 below:


Figure 1 - Pivot Table


Figure 2 - Calculated item


Figure 3 - Results

Not very pretty at all.

As people searched for a work around to this problem 3 common solutions have arisen:
  1. Use HTML formatting tricks to “hide” trigger text in the results, then conditionally format off those triggers. While inventive, as the comments note, this solution falls flat if the report is ever printed, as the PDF engine will pick up and display all of the hidden characters.

  2. Convert the pivot table to a regular table with some complex column formulas. Very time consuming and cumbersome, would also not solve the requirement of showing the dimension values noted as noted in Footnote1.

  3.  Convert the calculated result to text and manually add your formatting characters. I don’t think this actually works since the calculated fields won’t accept logical SQL functions, and this would be very cumbersome.
Now with 11g providing conditional formatting that allows you to override the default data format, this is possible via the following steps:
  1. Add a column that is a COUNT DISTINCT on the dimension that you are calculating across ( in the displayed example, “Time T05 Per Name Year”. This column will serve as your “trigger” to apply your conditional formatting.

    Figure 4 - Column Formula

  2. For each of your facts, apply a conditional format that is triggered when the above column value is zero. In the formatting, apply whatever visual and data formats you desire. In this example we will format the data as a percent, with one decimal place.

    Figure 5 - Condition


    Figure 6 - Format when condition is met

  3. Exclude the “trigger” column from your pivot view. View your results and be satisfied:

    Figure 7 - Correct formatting of calculated item.

* Note that this would also allow you to apply visual formatting if you wanted to distinguish this row/column as a total.

Why it works

The use of conditional formatting that applies a data type as part of the format is a straightforward leap of logic, but what to use as the trigger? Most people will try to use the dimension they have setup the calculation in. However, if you try to use the text description given to the calculated item you will find that the condition is never applied:

Figure 8 - Condition on dimension

Figure 9 - Condition never met, format never applied

If you try to setup a filter that is true when the dimension is not in reasonable range of values ( in this example we try to format off all years not in the 2000s ) you will find that your calculated item is skipped as well (this has the added vulnerability of being very explicit):

Figure 10 - Condition on dimension values


Figure 11- Condition never met, format never applied

The reason for all this is that the calculated item “borrows” EACH of the dimension values it operates against. Hence, no matter how inventive your filter is, as long as you are trying to somehow separate the calculated member away from the members it is operating on, you will never succeed. This member “borrowing” is apparent if you add the dimension it operates against to the query a 2nd time, and look at the table view.

Figure 12 - Calculated item "borrows" members

But since the “member value” given to the calculated item does not actually exist in the dimension, if you try to perform a count distinct against it, you will always get zero.

Figure 13 - Count distinct against dimension

There is your difference; there is your “trigger.” The rest is basic formatting.

1: You might suggest that this requirement is better served using column(s) with time series calculations, and you might be right. However, more often than not the user will want to SEE the time periods being compared ( 2012 vs 2011, or 08/07/2012 vs 08/07/2011). When using facts with time series calculations you will only be able to show “this year” vs “last year” since the column heading of the time series calculated fact will always be static. In these cases you will need to use the base fact and a time dimension, along with the solution provided here.

2: All screen shots, and examples used in this post are performed in Sample App V305. An XML of the final correctly formatted report can be downloaded here.

Friday, October 19, 2012

Random Idea #1

(800)

I'd like to start posting my random (rambling?) ideas here in short form more often. Here's idea #1.

I'd like to do a presentation with Cary Millsap while playing catch. I'd ask questions about instrumentation and stuff and he'd opine while trying to catch my knuckle-ball.

This would achieve 3 objects:
1. Presenting (with Mr. Millsap)
2. Playing catch
3. Playing catch indoors (technically this would be Mr. Millsap's completed objective).

Tuesday, October 18, 2011

KScope + DevOps

Last year I had the pleasure of getting the Sunday Symposium together for KScope 11, this year, I have completed my takeover of the Database track by becoming the track lead.

I thought this was the best job ever, then I was attacked Nancy Kerrigan style by my handlers.

All that said, I think I've gathered a pretty good group of people to help review and select the abstracts for next year's conference (San Antonio, TX).

There will be 4 sub-tracks this year:
- Design/Data Modeling
- Maintenance (Performance, Tuning, Upgrades)
- MySQL
- (Dev)Operations

The one I am most excited about is the (Dev)Operations sub-track, aka, DevOps.

What is DevOps?

I'm glad you asked..

"DevOps" is an emerging set of principles, methods and practices for communication, collaboration and integration between software development (application/software engineering) and IT operations (systems administration/infrastructure) professionals.[1] It has developed in response to the emerging understanding of the interdependence and importance of both the development and operations disciplines in meeting an organization's goal of rapidly producing software products and services.

I am not necessarily a fan of the movement, but I am a fan of the principles behind it.

Every developer has a story about working with an evil DBA. LIkewise, every DBA has a story about some application that went to production where they were left completely out of the process.

But it is more than just a simple, "Can't we all just get along?" plea, this is about creating better software and streamlining processes.

My personal experience has been one of woeful cooperation, at any level. Our thought, our hope, is that this well help give other Oracle professionals better ideas on how to start down this road.

If you are interested in this topic, sign up. If you want to present on this (or any other) topic, register here.

Monday, May 9, 2011

ODTUG Kscope 11: Tools Tools Tools v2.0

A couple of weeks ago I wrote about the cool Sunday Symposium I have been allowed to put together for KScope11.

Well, someone had to back out. I won't mention names, but they didn't really verify the time and dates. Said person had the audacity to take a vacation!

I wasn't going to name names, but I will, it's Jeff Smith, aka @HillbillyToad.

I'm not really mad (just don't tell him, I like to keep him on his toes). I like Jeff's presentation style a lot, he came down and spoke to our user group about a year ago. He makes me almost want to use Toad. Almost.

Anyway, since he couldn't speak, I had to find another speaker.

Hmmm...

Ideas?

Wait, I heard there was a big name attending last week didn't I?

That's right, none other than Mr. Thomas Kyte.

Maybe he would "fill in" for Jeff?

As is my mantra, the worst thing anyone can say is "No."

So I asked, and he accepted (and I must find a gift for his wife...).



So to recap:

Cary Millsap will be kind of a facilitator. Kris Rice will be speaking twice. Robyn Sands, Sten Vesterli, Sue Harper, Marc de Oliviera and finally the Dominic Delmolino. Wow. It's gonna be a great day!

Friday, December 17, 2010

Fun Day

Today was the day of my presentation.

Around 4:30 this morning, as I was trying to fall asleep, I had wondered whether I would wake up or not in time. I did, but it took me 2 hours to wake up from not sleeping much. I was a tad nervous. Fortunately I didn't have to get up in front of people, I just had to talk into the phone. The downside to that is that I was just talking into a phone.

I'm probably what you would call a "people person" and over my many moves as a kid, reading people is something I do fairly well. Not seeing them puts me at a disadvantage...but I digress.

The topic of my presentation was twitter and how it can be used to help you professionally. More precisely (and named by Ms. Malone), Professionally Speaking in 140 Characters or Less: How Twitter Can Help Your Career. I've benefited greatly from my use of twitter, I just want to share that with others in the hopes they they can find value out of it. A popular misconception of twitter is that people twit about taking a shit. Well, I haven't seen one person tweet about that...although I'm sure someone has. I like to think that I follow a classy bunch of folks.

Anyway, here is the final presentation, if you would like to download it. Here's the prezi twitter presentation, but it will be changing if not completely trashed.



While riding the high of my first presentation in almost 3 years, @surachart posted this:



A couple of months ago I had been contacted about a profile for Oracle Magazine. I wonder if this was the one?



Page can be found here. Online version of the magazine can be found here.

So, it was a super cool day for me. I celebrated by having 2 Sierra Nevada India Pale Ales (and unlocking 2 new badges) and then falling asleep (crashing) around 9:30 PM.

Sunday, June 20, 2010

SOUG: APEX 4.0

The much anticipated APEX 4.0 release is coming soon...in that spirit, Dan McGhan [blog|twitter] will be presenting on the new features. You might remember Dan, he's the one that constantly interrupted me during my first presentation ever, on APEX. We followed that up with a "joint" (by joint I mean I "let" him do all the work) presentation a few months later.

The event goes from 6 until 8 with the first half hour dedicated to eating and greeting. From 6:30 to 8 will be Dan's presentation.

You can read the event details here. Or I can just put it all here to save you a click (you're welcome):

Dan McGhan, our resident APEX expert, will be bringing us up to speed on the recent new release of Oracle's Application Express. APEX 4.0 is expected to be the biggest release in the product's history.

This session will break down many of the exciting new features that everyone has been looking forward to, including Websheets, Dynamic Actions, and Plug-ins, just to name a few. With APEX 4.0, development should be faster and easier than ever.

Dan McGhan has been a long time member of the SOUG. Dan is an Oracle Application Express expert and advocate. In addition to his "day job" with SkillBuilders.com, he is one of the top 10 contributors to the APEX forum, maintains his own Oracle and APEX blog, and has been a speaker at the New York Oracle Users Group, New England Oracle Users Group, and Suncoast Oracle Users Group events.

Thursday, May 13, 2010

SOUG: OLTP DBA's Guide to OLAP

Two weeks from today (May 27th) the Suncoast Oracle Users Group (SOUG) will be hosting Stewart Bryson of RittmanMead America.

Mr. Bryson's presentation is titled, The OLTP DBA's Guide to Delivering a Dimensional Model.

Meeting information can be found here.

I haven't seen Mr. Bryson present yet but I have heard rumors.

Wednesday, March 24, 2010

SOUG + Toad

We had our monthly meeting tonight with Jeff Smith from Toad.

Although I am mostly a SQL*Plus snob, I can appreciate good tools (snicker...wait, that didn't sound right). Ummm...nevermind. No matter how I say it, it's not going to sound right. You know what I mean...get your mind out of the gutter.

My first exposure to Toad was...I was looking for a picture, but I can't find one. Let's just say this reminds me of it:



That picture is courtesy of The DailyWTF

Needless to say, after the Google-like simplicity of SQL*Plus, I had no desire what-so-ever to try it.

Like most things, it has evolved. The interface is much cleaner and is (maybe was always?) highly configurable.

Let's just say I didn't run screaming from the room this time.

<background>
I was a Microsoft Access "developer" masquerading as a secretary for a state run university. Access, at the time, was the best thing since sliced bread.

When I came to the Oracle world I was "handed" SQL*Plus and a tnsnames.ora file and told to get to work. Where were the pretty pictures? How can I "see" my tables? Within a week or two I believe I created an ODBC datasource and used Access as a front-end so that I could "see" stuff.
</background>

In Mr. Smith's capable hands, Toad didn't look so bad. I'm not ready to pay for it yet, but it was much better than I previously thought.

The session was informal with Mr. Smith taking a survey of the audience; naturally dominated by those neavil DBAs. I do know, and have used, the DBA module in Toad and found it quite useful.

One very cool feature was the ability to generate random data...with referential integrity. Awesome feature if you "like" to test. Building fake data can be a very time consuming process...building data that has RI, well, it is just painful.

The best feature was Spotlight. This is more of a DBA tool; it let's you view high level performance metrics and the interface to this is very cool...star trek like.

For a non-RAC system:



RAC:



After Party
Post-presentation festivities included a trip to the local Mexican restaurant and chance to meet SQLChicken, a local SQL Server guru guy who was born 4 years ago.

I haven't shaved in about a month and my beard is completely out of control, so hopefully I didn't scare them too much.

Thanks Jeff (and Quest) for extending your stay so you could speak to our group.

Sunday, March 7, 2010

OBIEE: Default Answers Template?

After trying out the lazyweb method of search (aka Twitter) and not getting much help, I resorted to help at the OTN OBIEE Forum. It's not Twitter's fault, I think this problem was a bit too complex to describe in 140 characters.

Here's the post on OTN. I started to get nervous too, I posted on Friday and hadn't had a response...until today. 3 days? Man...that's way too long!

Here's the short of it.

Our reports were coming out funny. Dimension column headings had one style and the Fact table column headings had another.

dim/fact difference

Using Firebug, I could easily isolate the sections.

On the Dimension column, the definition looked like this:
<th  
class="ColumnHdg"
style="background-color: rgb(231, 231, 247); font-size: 9px; color: rgb(0, 51, 102);"
scope="col"
dir="ltr">Product Desc
</th>
The Fact table column was defined as:
<th 
class="ColumnHdg"
scope="col"
dir="ltr">Basis Amount
</th>
Note the style attribute...that overrides any class settings. Very annoying.

I thought it would be relatively simple to fix. I worked with custom messages before, this had to be similar. So I began to "grep" the messages directory
c:\oraclebi\web\msgdb\>findstr /i /m /s /c:"background-color" *.*
Nothing.

How about looking for the name of the class, ColumnHdg?
c:\oraclebi\web\msgdb\>findstr /i /m /s /c:"columnhdg" *.*
messages\criteriatemplates.xml
messages\formattemplates.xml
messages\mktgadminuitemplates.xml
messages\mktgcommontemplates.xml
messages\mktglistformattemplates.xml
messages\mktgsegmenttemplates.xml
So I start with criteriatemplates.xml and find the reference to columnHdg (just now realizing that the case doesn't match...oh well). That was part of the WebMessage kuiColumnFormulaEditor. So I searched for that...

You see where I'm going.

That lead me to the javascript files (of which there are tons). Nothing...not a single thing that could possibly be adding this style attribute.

That's when I mapped the dev server drive to my local computer and opened up WinMerge

I then began to compare every single file in both the msgdb and res (javascript) folders. I would then compare the files that were different to see if that could be the cause. Still...nothing.

I had looked in the webcat before, but couldn't find anything of global significance. I was headed back there though since I had lost hope with custom messages and/or javascript.

Then I got a message from the OTN Forum Administrator...could it be? Looked at the name of the person who answered it first, John Minkjan...sweet!
Looks like you forgot to reset the OOB settings when installing OBIEE:
have a look here to reset them:
http://obiee101.blogspot.com/2009/02/obiee-editing-system-wide-defaults.html
Click through, follow his instructions, bounce the server and voila!

voila!

As of this writing, I don't know what OOB stands for; I could make something up, but it probably wouldn't be appropriate for this family site.

Thanks John!

Thursday, April 24, 2008

ApEx Presenting = FUN!

Wow...that's all I can say.

At lunch today, I put together my power point presentation. I meant to do it sooner of course, but it's been another busy week. In fact, I hadn't done a thing to prepare other than walking through it in my head.

I did not want this to be a presentation so much as a demo. Six slides is all they got.

I suddenly got very nervous around 4 today. I just want to get over there and start. I ended up leaving work just before 5.

The meeting was at the PriceWaterhouseCoopers building in Tampa, just across the street from the Tampa Bay Buccaneers headquarters. Very nice building.

The Presentation


I was introduced by the SOUG president promptly at 6:30. Roughly 40 people showed up (filled the room).

I had an hour and a half to complete my presentation...ummm...WHAT? I've got like 10 minutes worth of material! How the hell am I going to manage this??

Anyway, I walked through some of the features of APEX: Load/Unload data, SQL Commands, that kind of stuff, just trying to get to the application builder.

A couple of nights ago I began walking through and building a basic little reporting application tailored to the DBAs. Reports on roles and privileges basically. I never even got to that.

I created a 2 line csv (yes, I should have done it before hand), uploaded it to demonstrate how easy it was and then off the creating a report on that table.

"Can you create a form to update that record?"

Sure, here's how you do it. One minute later the form was done and I had updated the record. True to form...it's just so damn easy.

I answered a few other questions and then I got stuck. A member of the audience started answering the questions that I couldn't. We (the member in the audience) had spoken before the meeting and I believe he's just as passionate about APEX as I am). It worked rather well, so well in fact, that we're going to try and work out a dual presentation at the upcoming Technology Day SOUG puts on.

Someone would ask a question, I would answer them by showing them how to do it. Have I mentioned how much I like APEX? Rocks.

Next thing I know, it's a little past 8 and I can see the President trying to end the meeting. No way dude, too many questions to answer!

I got out of there around 9:30. I answered questions to the best of my ability...if I didn't know, pointed them to resources that could.

Exhilarating!

Can't wait to do it again...but next time I'll practice!

update
BTW, great crowd tonight. I couldn't have asked for a better group. Thanks to everyone for their support, and thanks to Tom and LewisC for asking me to do it.

Did I mention how cool it was? ;)

Monday, April 21, 2008

ApEx Presentation

I'll be doing my first professional IT presentation this Thursday for the Suncoast Oracle Users Group.

I'm a bit nervous, but excited at the same time. My goal is to make it as interactive as possible and just let it take me where it takes me.

I will have a canned demo, but I would rather it be more fluid. Can't always plan for those things...I could be a total bust!

So, if you're in the neighborhood and you want to check it out (or just laugh and heckle me), come on by. Details can be found here.