Practical Business Objects Developer Tips

I’ve been meaning to write up a good practice guide for Business Objects developers for some time now.

I have finally managed to find some time to put together a list of tips I’ve used over the years. I hope you find the following list of tips useful in some small way.

If after reading this article, you come away with something knew, then I’ll be very happy.

I’m going to keep this post going for a while, adding to it as and when I can. But more importantly, I’d love for you to share your developer tips. I know there is a wide community of Business Objects experts out there, so please help develop this list so we can all benefit from our shared experiences.

If you’d like to share a tip or two, please add a comment to the post. I’ll then add it to the main list and give you a name check!

Universe Designer Application

• Use business terminology for all universe objects – always. The universe is the semantic layer between the business and IT.
• Wherever possible, and certainly for measures and calculated objects, add a description to the object.
• Ensure your object is formatted correctly. Pay particular attention to dates and numeric fields.
• Create filtered prompts wherever possible. Anything which can help the user get their data more efficiently helps. Remember to allow the selection of all data.
• Ensure your List of Values (LOV) is sorted. Don’t assume it will be.
• Don’t create a LOV on a measure.
• If you have to create a LOV on a dimension with many data items, consider grouping those items.
• Group your universe objects into a logical order. Create something that the business will understand and be familiar with.
• Create different time periods – users like to compare current year to date to last year to date, quarter to date, month to date, etc.
• Contexts – these can be incredibly useful. But they can become terribly confusing to the end user. If you really have to put in a context, do so, but make sure it has a meaningful name and description. If your user is presented with a context prompt box, it should be absolutely clear to them which context to choose. If it isn’t, you need to revisit your context or approach. The purpose of the tool is to help the end user get their results. Remember that.
• For fields based on free form input text, consider trimming the field. Profiling your data beforehand should help you identify these fields.

Reporter Application

The Query Panel

• Only use objects that you are going to use in your report.
• Put the objects in the order that you would like them sorted on the report if possible.
• Move your measures to the end.
• Use pre-defined (universe) filters if available.
• Avoid hard coding values wherever possible – use prompts instead.
• If you are not familiar with your data set, restrict the number of rows returned by your original query. If you are happy with the result set, you can remove this restriction. The last thing you need is to run the mother of all queries.
• Make prompts meaningful. If you are prompting for a date, include an example of the expected format. If a user can enter a ‘*’ to select all values, say so.
• Get the server to do the work rather than the report. Not all end user PC’s are high spec.
• If you are going to use multiple queries, give each query a meaningful name.

Report Design

• Create a report header tab/page – this should list the report title, parameters used, descriptions, values entered at the prompts, last refreshed date.
• Ensure the report opens on this header page. This should result in a faster opening report.
• Keep the report look and feel the same throughout – table positions, headers, fonts and colours.
• For tables that span across several pages, repeat the header on every new page.
• Dates – who is your target audience? US and UK data formats differ. If you do not know who your audience is, or if it is a worldwide audience, specify the format of the dates in the header page of the report or the column heading.
• Decimal places – how many decimal places do you need to report on? How many decimal places are used in the calculation?
• When working with large numbers with several digits, consider dividing by a thousand or a million. Ensure the report states that you are reporting in that way.
• Include error handling in any calculations performed on the fly. Pay special attention to DIV/0 errors. Use the IsError function. This post may help.
• For all new formulas you create, consider putting them into a variable to allow reuse and easy maintenance. Prefix the variable name with v_ to make them easily identifiable.
• Include a cell at the bottom of your report to show the last refreshed date.
• Build in a very visible partial refreshed alert. All too often that yellow triangle is overlooked by users. This post may help.
• Number your report pages. ‘Page n of n’ works well.
• Give the report a meaningful name. Include a description. Keywords are helpful too for searching.
• Consider a numbering scheme for your reports. E.g. first digit represents dept/function, second digit represents area, etc. E.g. 104 – Sales Report London, 105 Sales Report New York, 204 – Finance Report London. This will allow rapid identification of a report series.
• Use autofit width or wrap text for longer fields. If you only want to display the first n characters of a field in a report, create a formula to do so (e.g. Left(,20))
• Be consistent with your fonts.
• Use a sensible font like Arial. Some of the more fancy fonts do not print too well, especially if a smaller size font is used.
• Consider how your users will use the report. If they tend to print reports, and they do not have a colour printer, avoid colour on your report. Colours on report don’t lend themselves well to output on a black and white printer. If you must use shading, consider greyscale. If you users only view reports on screen, colours can help identify sections of data.
• Use alerters. These are a great tool for bringing data to the users attention. Given them a meaningful name and description.
• Optimise your report for speed – reduce or eliminate unused formulas, alerters and formatting. Keep it simple.
• Consider the use of section breaks to break up large tables. These can be easily searched in the side panel.
• Before publishing or releasing a report to production, do a print preview. Does the report print out as you’d expect? Do you need to save the report in landscape. Also save to Excel. Are any fields appearing incorrectly formatted?
• Big reports – Do your users really need that 100 page report? Really? If all they are after is a data dump, a more efficient way to deliver this is to write a piece of SQL code and save the result as a CSV file. But always ask why they want a data dump in the first place. What they do with the data? BOBJ is a powerful tool. Show them how to do what they want to do. Use it.
• Save your work regularly. You never know when the power will go, or an application will crash. If you have spent the last couple of hours working on a report, it’s not going to hurt to hit that save button. I normally save every significant change as a new version. Once I have a report ready for production, I’ll delete those versions.
• Images such as a corporate logo can be inserted into reports. But keep the images small. Use a file format that compresses the image to a sensible size. Don’t even think about inserted a large 1mb image on every page. This post may help.
• Make use of multiple tabs in the report. However, avoid hard coding date values in these tabs. You will have to maintain these later.
• If you have a particularly complex report, add a tab that provides the detail behind the report. This will aid future developers.
• If you have one set of users that simply love to play with data, and others who want a formatted report, consider adding a Data Dump tab at the end of your report. This should be a simple table with zero formatting.
• Prior to release to UAT/Production, delete any unused variables and formulas.
• If running multiple queries, ensure the relevant dimensions are linked.
• Purge your report before release to production. The data may be obsolete by the time the user retrieves the report and it will be bigger than it needs to be.
• For corporate reports, consider developing a standard report template
• If your company reports in several currencies, ensure the measures on your report are clear as to what currency is being used.
• Avoid falling into the trap of creating several versions of essentially the same report. Remove hard coding and make the report as generic as possible. Use prompts. If a user wants a new field, can it be added to an existing report or do you need to create a duplicate with the new field?
• If you use graphs, keep them simple. Avoid 3D graphs. Read a good book on Data Visualisation to understand how to deliver data in a visual format. This post may help.
• If you have multiple tabs in a section, ensure that they are positioned relative to each other. Same applies to floating cells. Ensure they are relative to something so that they don’t overlap with other objects on your report.
• Percentages should be calculated within the report to ensure it is in context.
• If you create a grouped variable, you need to check that all possible values for that dimension are grouped. If not, the next time you run that report, you may find data that is not sitting in a group. This could lead to misleading results.

How to add or subtract a number of days from a date field in Web Intelligence

A report developer may be required to display a date field in a report which is made up of an existing date field plus/minus x number of days. A good example of this may be a report developed for the credit control function where you have issued an invoice on 30 day terms. The credit control team may want to identify those invoices which have exceeded those 30 days terms.

WebIntelligence provides a function to allow us to do this:

RelativeDate()

This function requires two values.

The first is the date field you wish to add/subtract from. The second value is the number of days you want to add or subtract. These two values are separated by a semi colon in WebIntelligence.

Note that the second value should be a numeric value and should not be in single or double quotes.

If you want to subtract a number of days, ensure that the value you enter is a negative number (proceeded by a minus sign).

Lets work through a couple of examples:

Adding seven days to a date field

Create your report and pull in a date field.

In this case I am using an object name called ‘Date Field’. Your date object may have a different name.

Add a new column to the right of the Date Field column, and build the following formula:

=RelativeDate([Date Field];)

*Replace the <number of days to add> with your value

=RelativeDate([Date Field];7)

This adds seven days to the value held in the Date Field

Subtracting seven days from a date field

Create your report and pull in a date field.

Add a new column to the right of the Date Field column, and build the following formula:

=RelativeDate([Date Field];-)

*Replace the <number of days to subtract> with your value. Remember that this should be a negative value.

=RelativeDate([Date Field];-7)

This subtracts seven days to the value held in the Date Field.

If you have access to Universe Designer, or can request a new object to be added to your reporting universe, we can take this to another level by making that value a dynamic field. This means that the user will be prompted for the number of days to add or subtract from the Date Field.

What if I want to prompt the user for a value to use in this formula?

This is possible. However, in order to do this, you need to add a new object to your Business Objects universe.

Create a new dummy object in the Business Objects universe which holds a User Response prompt.

Give it a meaningful name such as User_Prompted_Days.

@Prompt(‘Enter number of days to add/subtract:’)

Save and export the universe.

Rebuild your report and pull your new object User_Prompted_Days into your query alongside your date object.

Refresh the report.

You should now be presented with the following prompt:

“Enter number of days to add/subtract:”

Enter a value. This value will get stored in the object called User_Prompted_Days.

We can now use this object to build up our new date column.

Add a new column, and populate this column with the following formula:

=RelativeDate([Date Field];ToNumber([User_Prompted_Days]))

We use ToNumber in this formula as the prompt value will be stored as a character string.

You should end up with a new date based on the value held in the Date Field column plus/minus the days entered by the user at the prompt.

This approach has a benefit in that the value entered by the user can be applied to any number of date fields you bring back in your report.

If you find that you only need to apply the user response to a particular date field, consider creating an object with the prompt built in:

The object code to subtract x days from the current date in SQL Server is:

convert(datetime,convert( varchar,dateadd(dd,-@Prompt(‘Number of days to subtract from current date:’,'N’,,MONO,FREE),getdate()),102))

The object code to add x days to the current date in SQL Server is:

convert(datetime,convert( varchar,dateadd(dd,@Prompt(‘Number of days to subtract from current date:’,'N’,,MONO,FREE),getdate()),102))

In case you missed it, the key difference in the two formulas is the minus sign before the @Prompt.

Hopefully this will have helped you understand how to add or remove days from a date field in Web Intelligence.

BusinessObjects: DocumentPartiallyRefreshed function

When developing a Business Objects or Web Intelligence report, how many of you can honestly put your hands up and state that you make use of the DocumentPartiallyRefreshed function? If I were a betting man, I’d bet that very few. Certainly on all the client sites I have worked at, I haven’t seen it used.

The DocumentPartiallyRefreshed function, is in fact a very handy function to incorporate into the cover page of any report you produce for end users. Why?

Well, for seasoned report developers, should a document not refresh fully, we would note a tiny yellow flashing icon in the bottom toolbar indicating a partial refresh. But it could very easily escape your attention. And I’m not sure many end users would recognise what it meant.

The danger of partially refreshed document is that action is taken by the business based on information held in that partially refreshed report.

“Yikes…our report is showing we only have 100 widgets left and we need to order more in for the weekend”. In fact, stock is showing over 1000 widgets in stock.

A trivial example, but you get what I mean.

So my tip for today is to add a cell to the cover page of your report (you do create cover pages don’t you? – maybe a future post).

The DocumentPartiallyRefreshed function is a boolean function which will return a 1 or a 0 (true or false) when the report is refreshed. If the report is partially refreshed, your value will be 1.

You can create a variable that wraps the DocumentPartiallyRefreshed function inside an If statement. So, If the document is partially refreshed then show this message else show this message.

A simple implementation of this is as follows:

=If (DocumentPartiallyRefreshed()) Then “***DOCUMENT PARTIALLY REFRESHED***” Else “Document has been refreshed”

We can take this a step further by adding a date of last full refresh:

=If (DocumentPartiallyRefreshed()) Then “***DOCUMENT PARTIALLY REFRESHED***” Else “Document last refreshed:”+FormatDate(LastExecutionDate(DataProvider()) ,”dd/mm/yyyy”)

So a user opens their ‘refreshed’ report, and if there has been a problem, the statement “***DOCUMENT PARTIALLY REFRESHED***” should be prominently displayed.

If you REALLY want to make sure the user notices this message, you could create an Alerter on the cell. If the document is partially refreshed, lets highlight the text in this cell a bright red colour.

To do this, create a formula as follows:

=DocumentPartiallyRefreshed()

Give the formula a variable name such as v_Partially_Refreshed.

Highlight the relevant cell on the cover page and click on the Alerter button.

Click Add to add a variable to compare. In our case, select v_Partially_Refreshed.

Operator 1 should be an equals sign and Value 1 should be 1.

Select the dropdown from the Result box and Format to your heart’s content. Red and Bold for this type of exception looks good.

For those using Web Intelligence, the DocumentPartiallyRefreshed function and the steps to create an Alerter are exactly the same.

There you have it. A practical use of the DocumentPartiallyRefreshed function.

Are there any other functions you would like me to cover in this blog? If so, drop me a comment and I will try to oblige.

SAP offer accelerated training packages for BI 4.0

I have recently found out that SAP offer accelerated learning packages for their product suite.

Of interest to most readers will be the SAP BI 4.0 package which can be found at:

https://training.sap.com/bundles/product/sap-bi

Purchase of the package requires your SAP login or a new registration.

For those that have experience in previous versions of the Business Objects product suite and need a helping hand to understand the new features of BI 4.0, this may be the way to go.

Bernard Liautaud on how he set up Business Objects

For those that are interested in the history of Business Objects, Timo Elliot has posted an interesting entry which embeds a video from the founder of Business Objects – Bernard Liautaud.

Quite a frank and open chat that he gave to the London Business School

Business Intelligence – Hot Skill for 2010

Wondering if your Business Objects skills will hold up in 2010?

Well have a read of Jon Reed’s excellent white paper about SAP career and skills trends in 2010.

Divided into two parts, take particular note of the table in Page 9 in the second part of the white paper. But don’t jump straight to this – the whole white paper makes for interesting reading.

Enjoy!

Adding a corporate logo to your reports

We often find that we need to add a corporate logo to Webi/Deski reports.

The simplest way that we have found to do this is to create a folder on the Webi server, apply the correct permissions, and reference the object within your report via a UNC path, e.g. //Webi/CorpLogo

As long as the permissions are correct, and the users have access to the server, this should work in both Webi and Deski reports.

Is Microsoft winning the BI race?

I just finished reading an interesting article written by Oudi Antebi of Panorama Software.

In it he states that the Microsoft BI path has been somewhat confusing over the past few years – what with their purchase of Proclarity, and it’s subsequent withdrawal (please bring it back!), it’s development of Performance Point Server, and it’s subsequent integration into Sharepoint. (And possibly PPS revival). This has left consumers and consultancies wondering whether to invest in the Microsoft BI stack at all.

However, Oudi points out that Microsoft may be following the pareto rule of 80/20 and trying to win the hearts of 80% of the BI population by integrating basic BI features into its Office and MOSS products. It is then happy to leave the remaining 20%, otherwise known as the power users, to use software from the likes of Panorama (shameful plug Oudi), Oracle and SAP Business Objects.

Oudi’s article is interesting on several levels.

Many of you will know that I am a fan of several BI applications – Panorama, Tableau and Qlikview. These powerful applications provide the end user with a simple GUI interface and allow you to really dig down into your data and present it in a wide variety of ways. The resulting output, I feel, is at the cutting edge of BI reporting.

Several vendors are looking at offering their wares over data you may (one day?) hold in the ‘cloud’. No doubt the cloud will grow in popularity over time and it removes the cost of purchasing and maintaining hardware on site. Google is not far behind either. It has been working on several initiatives including Google Wave and Google Squared. Google has in fact worked closely with Panorama on several projects involving its Google spreadsheet application. Google also bought the rights to the Gapminder graphical application which allows you to view you data over several dimensions over a moving time period. Fantastic product and demonstrated like no other by Ola Rosling in several conferences. I wrote about a presentation he done at TED which was unbelievable. But I digress.

The fact is that Oubi thinks that this is a race with one winner.

I disagree.

Microsoft, with its current BI stack, will not win the BI race. In fact, I don’t think there will be or can be a winner. BI means different things to different people. BI is vital to all organisations, and will one day be used by every employee at every level. From basic tabular reports, to graphs to dashboards. We are all living in an age where we are confronted by mountains of data. Data storage is growing exponentially. Simply look at the size of your home storage, and the volume of music or photos or files that you may store. How does that compare to your system of 5 years ago? And imagine the data being collected by telecoms companies, retail companies, reward schemes, etc. So any system which can aggregate that data, cleanse it and present it in a form which is accurate, timely and relevant will be of enormous value to an organisation.

There are people who prefer to see tables of data for which Excel is an excellent option. There are others who want to track metrics and KPI’s, and several applications, including Xcelsius allow you to do just that. Other people or power users may want to drill down into the underlying data, to really determine the causes of a strange number – an outlier. Several companies are offering applications on mobile devices such as the iPhone, as discussed here by Timo Elliot. Again, this advance will satisfy a small subset of the BI community.

Price also plays an important part, and this is where Microsoft will win many hearts and minds, and perhaps more importantly, the signature on the purchase order. A number of BI vendor solutions are very expensive indeed. Others are more realistically priced, and several Microsoft solutions may be used at no additional cost depending on the type of licence you hold. With Office being the predominant application on users desktops, embedding simple BI functionality into Excel is a no brainer. Perhaps an organisation is using Sharepoint as an internal document portal. Well, now you can put up some dashboards using PPS functionality.

While I think there is a big place for Microsoft in the BI world, I certainly don’t think it is going to be the ‘winner’. Smaller, more nimble BI software companies, are pushing the boundaries of what can be achieved with BI, offering us with ever more imaginative ways of viewing our data and extracting the key information we need to know. Several of the larger vendors offer organisations a strong case to use use their complete stack, from database, to ETL and data cleansing, to creating cubes/universes, reports and right through to dashboards and KPI’s. A one stop solution from one of the largest BI vendors.

These vendors are focused 100% on BI.

Not Office.

Not Windows.

Not XBox.

Just BI.

And having a laser like focus on BI will give these organisations the edge to develop the very best products on the market.

SAP TechEd 2009

My previous post brought your attention to the SAP World Tour 2009, an event focused on IT directors, managers and executives.

If you are a developer, and feel a bit left out, fear not!

SAP TechEd2009 is being hosted in the following locations:

  • Phoenix October 13-16
  • Vienna October 27-29
  • Shanghai November 11-12
  • Bangalore November 18-20

These events are normally packed with ideas, hints and tips that you can take back with you and implement.

Jon Reed from jonerp.com has written a number of interesting posts about previous TechEd events that are well worth reading.

Registration is still open, and if you apply early enough, there are some early bird conference fee reductions you can benefit from.

SAP World Tour 2009

SAP Business Objects are hosting their World Tour at locations throughout the world over the coming months. Under the banner of the SAP World Tour 2009, the UK presentation will be held at the NEC Centre in Birmingham UK on July 15th.

There are the usual keynote presentations as well as several breakout sessions – one stream focusing solely on Business Intelligence (listed below):

11.30 – 12.15
SAP BusinessObjects: Optimizing Business Performance
Mike Morini, SAP

12.15 – 13.00
A – Z of Business Intelligence
Phil Wood, SAP BusinessObjects

14.00 – 14.45
The Importance of Business Intelligence – During Market Growth & Recession
Richard Neale, SAP BusinessObjects

14.45 – 15.30
Revolutionizing your Business Intelligence (with SAP BusinessObjects Explorer)
Chris Darvill SAP BusinessObjects and Stewart Faith, BI Specialist

16.00 – 16.45
A New Era in Information Management
Richard Neale and Barry Dodds SAP BusinessObjects

16.45 – 17.30
BI for SAP Customers (Designing a BI strategy for your SAP Landscape)
Chris Darvill, SAP BusinessObjects

The tour is mainly focused on executives, IT decision makers and business managers. Registration for the event is free, and registration is still open, so if you are available and want to learn more about SAP and it’s future vision, it is an event well worth attending.

Follow

Get every new post delivered to your Inbox.