Archive for the ‘cognos’ Category

You are currently browsing the archives for the cognos category.


Macro functions and prompts in Cognos BI reports

This post spent a year in drafts -( But Macro functions are an interesting feature of Cognos BI and sometimes their usage is unavoidable.

You can use macro functions in Report Studio to do some manipulations with prompt values before they are used for actual processing in filters, report functions, etc.
As a general (and very common) example, you can use macro functions to do datetime format transformations, to allow one various filters to be based on a single prompt (selecting 'Version X, year 2009' in prompt, which you can split up to two filters, for year and version) and do some other string conversion stuff.
Usually such need arises, when you have drill-through reports with different source-target dimension member formats, such as OLAP (Transformer, TM1, Ms AS, Essbase) -> Relational or vice versa. For example (a very simple and not close to real-life), if you have a detailed transaction-level report based on relational database and a MOLAP-aggregated data on top of it.

Fictional Example

If, for example, your date MUNs in OLAP are like '2010-02-10' and relational database expects something like '2010.02.10', you can change string value of prompt by changing filter in detail report from

date = ?date_prompt?

to

date = #subtitute('-','.',prompt(date_prompt,'string','1'))#

prompt macro function returns prompt value and substitute subtitutes strings )

Real-life example

One of real-life examples, where I had to use macro functions extensivly was OLAP(Essbase) to Relational drillthrough setup.
When using Essbase it's better to have unique member names for dimension elements since this speeds query time a bit. So usually some unique identifiers are added to common conformed dimensions. On this project we've constructed a cube with financial transactions, with a number of participants for each operation. The same company can be a client in some operation and a supplier in another. So unique postfixes were added to each of dimensions in Essbase cube. Relational model for Oracle, however, had a single "Party" dimension table, which contained all possible participants.
This problem is easily solved with tecnique given above, I've just removed unique identifier.
The other problem in the same case is that Essbase dimensions usually have hierarchies ) Since operation participants can be aggregated by industry or region I can receive industry (or region) label in dimension prompt (building special prompts for each level is just impossible).
So I had to detect the level of member I've received (which was easier by having those unique level identifiers) and then to filter accoding column in relational table. So I can receive values like 'Pharmaceuticals SUPPLIER INDUSTRY' or '10241235 SUPPLIER ID' from Essbase. Creating such a filter turns into filter like:

when (#sq(sb(csv (grep(': SUPPLIER_INDUSTRY';array(prompt('SUPPLIER_ID';'string';'1')))) ))#,'[]') THEN
([Relational Souce].[Supplier].[SUPPLIER_INDUSTRY] = #substitute(': SUPPLIER SUPPLIER_INDUSTRY';'';prompt('SUPPLIER_ID';'string';'1'))#)
when (#sq(sb(csv (grep(': SUPPLIER ID';array(prompt('SUPPLIER_ID';'string';'1')))) ))# ,'[]') THEN
([Relational Souce].[Supplier].[ID]= #substitute(': SUPPLIER ID';'';prompt('SUPPLIER_ID';'string';'1'))#)
else (1=1)

This really looks awfull, but it's the only way I could find out to do 'search': that is to form an array from prompt values and do a 'grep' over it and compare it with empty string. But it does the trick nicely.

Oracle BI Enterprise Edition vs Cognos BI

Since I've spent some time working with Oracle Business Intelligence last year, I think I'd write a simple comparison list of strengths\weaknesess of OraBI EE vs Cognos (see post on the same topic by Venkatakrishnan). All of this is imho, of course.

Oracle BI EE Pro's:

1) Aggregate navigation

-- ability to set up aggregate tables in BI EE itself, which gives it 'aggregate awareness' while generating SQL. So if you have monthly sales aggregate you just set up BI metadata accordingly and all reports will target this table for monthly data.
There's no such feature in Cognos metadata setting.
But using this feature arises some questions:
a) whether aggregate definition should be BI-tool specific. A lot of practioners, including Kimball, insist that aggregate navigator should reside at database level so that every tool querying datawarehouse will benefit from aggregate avalaibility. This seems rather reasonable, since every datawarehouse is usually queried by more than one analytical application (BI, datamining, more BI) so you either direct all applications to BI EE, or agree to performance degradation.
b) aggregate tables desynch. When you just update the base fact table, aggregate tables become "out of synch", providing incorrect query results untill they're recalculated. This means that you either can guarantee that nobody will access reports in this period, or you can have incorrect data. Since more&more datawarehouses squezee load windows to reach real-time this problem gains priority.
c) choosing which agregate to use for answering questions. That's what statistics is all about in dbms, knowing number of rows and value distribution (lol). Oracle BI EE has the "table row count" feature (although I haven't seen it affect SQL generation yet, need more examples). But there's no value distribution analysis in there, so it's just one side of the coin (not talking about I\O device speed and other characteristics).

In general, it's recommended to use database-specific aggregate table functionality (Oracle Materialized Views or DB2 MQT) since it solves all the 3 questions given above and usually simplifies ETL process (and sometimes even speeds it up, since databases use their own transaction logs to detect what data has changed and what aggregates should be rebuilt). Too bad indexed views in Ms SQL do not work with aggregate dimensions (there's no way to define dimension hierachies there).

2) Cache management

-- OraBI has really profound cache management facility. You can "cache" any database query to OraBI specific storage structure (cache file), wich will allow subsequent queries to the same table\query to run without actual database request being made. This can greatly speed things up. I especially like the Event Polling Table feature: you add a table, which records when dwh table was last updated. OraBI then reads at given intervals and automatically invalidates old cache entries, based on this table records.
Moreover, if you have OraBI cluster this cache can be shared among servers.

There isn't anything even close in Cognos.

Although I greatly like this feature, I just want to warn about overusing it. It's easy to imagine BI developers boosting performance by adding more&more cache untill OraBI becomes a fully blown aggregate system. And sometimes it's just about 1 aggregate table at the dwh level ) Or about introducing OLAP server in the enviroment )))

3) SQL generation.

It's tricky subject, but for now I like OraBI generated SQL more. But it's "apples to oranges" for sure, since I usually use DMR's in Cognos which encumbers SQL greatly and there's nothing identical in OraBI EE.

Oracle BI EE Con's:

1) Multidimensionality

Cognos has Analysis studio and the ability to navigate hierarchies in both directions (you won't believe it, but in OraBI there's no 'Drill-Up', only'Drill-Down'). And DMR's and analytical functions (but their usage is a bit annoying, as it seems now, hope to write about it later). Anyway, Cognos is way much more 'multidimensionally-ready' than OraBI.

OraBI + Essbase is a work in progress and has a huge number of caveats (some fixed by patches, some not, some introduced). And the only way to use all Essbase functionality is to write direct MDX via Evaluate functions. That's a big problem, since it's hard for us to suggest OraBI on top of Essbase for now (till 11g once again). The only alternative is Visual Explorer, which is a very good tool, but it for top-analysts only (thick client, costly).

2) Metadata model development

Instead of OraBI's 'only-star schema', '3 layers of model' Cognos FM Manager doesn't impose any design principles, which allows more mistakes, but it makes some things way more simple. One of the first things I wanted to do in OraBI was a report using just a single table.  Well that's a really funny exercise (see posts over here) if a star schema is a must.

But the main problem is the lack of API for metadata changing and browsing. There's udml, but it's not supported officially. Therefore all current integration scripts (like adding users, merging repositories and working with hierarchy depth changes) are out of the law. Which doesn't stop anyone, but is pretty annoying.

3) Pixel-perfect reports

Oracle BI Publisher is a specific tool, aimed at generating a huge number of formatted reports, based on XML format definition files. It wasn't a part of Siebel BI, so 'integration stitches' still stand out. It's a nice tool, but it certainly lacks web-interface ) Therefore in Oracle BI there's a deep distinction between a simple formatted report (with lots of possible logic in it) and making this report 'printer-friendly' since for the latter you basically have to start from scratch by opening Ms Word )  This will change in 11g as they say )

Having said all that, I really wait for Oracle BI 11g edition to start using it with Essbase and I kinda like the product as it is for "relational-only" reporting.

I surely wanted to write a simple bullet point list at first )

Memory leaking in Cognos 8.3 BI

You know why i've started this blog in the first place? To get advice, of course. And today DesiCresnet shared a wonderfull piece of information concerning memory troubles in BI 8.3.

Those who aren't struck by occasional CAM-AAA-0071 “An internal error occurred” which stops the whole server can skip this post.
This error was discussed at:

http://www.ibm.com/developerworks/forums/thread.jspa?threadID=244357

http://www.cognoise.com/community/index.php?topic=4971.0

The story goes like this:
- java.exe (that powers BI), grows up to the point where it cannot obtain contigious memory from server and crashes
- Cognos BI doesn't recognize this error, so it throws out a general CAM-AAA-0071
- Cognos BI is unaccessible until restart

This error occurs more often in heavy-usage enviroments. In one of our projects, with lots of Event triggered admin-links and reports, it took only a coulple of hours before it striked.

Solution is not complete, but as I see it now:
1) Put the latest SP on BI (or a special hotfix, if one is avalaible)
2) Lower the avalaible memory for Cognos BI service (to 768 mbs)
3) Modify the HeapDecommitFreeBlockThreshold registry property

It's interesting if 8.4 is prone to such error.

PS: I'm a certified Cognos Technical Specialist now, as well. Need to get first-line support partnership, you know )

Cognos 8 EP troubleshooting import data from package

Tip of the day: Having common metadata layer for BI and Enterprise Planning is really cool, especially with the ability to load data from BI packages to EP via links. Just that it sometimes doesn't work. But there are always some workarounds.

With mostly very cryptical error messages or without any.
One of the problems might be just that DataManager service (which does the transfer) cannot allocate enough memory for operation. This is what we've encountered just today.

Good news are that this parameter is easily configurable, you can just edit cognos_install_path\bin\dataimportserviceconfig.xml file and set JMX (Java maximum allocated memory) to something more appropriate than default 128M (1024 is a nice number, for example).

Try this if your links fail ;)

PS: In this 'wonderfull' Java world, setting JVMX is a common boost-up technique. And there's a lot of places to apply it. Think about Cognos Rich Client Platform (Cognos 8.4 Contributor) for start...

Cognos 8 BI Tuning Hard Drive Usage

Just a quick hint and a reminder: there is a configuration option forcing Cognos to store temporary report results in memory rather than dropping them on disk. It's especially usefull for DMR's they are frequently cached on disk.

Quote from Architecture and Deployment Guide.

Depending on the size of reports and the amount of available memory, IBM Cognos 8 may access a physical disk when processing reports. To improve performance, you can ensure that report processing uses available memory rather than disk space. Using memory instead of disk space is particularly beneficial in cases where temporary files are
created on IBM Cognos 8 servers, causing information transfer from memory to disk. You can monitor the occurrence of temporary files using the c8_location\temp directory.Monitor this folder during report processing periods to determine whether temporary files are created as cclvpage*.tmp. To ensure that IBM Cognos 8 uses memory instead of disk space, in the rsvpproperties.xml file, edit the VirtualMemoryDiagnostics property to use unlimited memory (value = 2) rather than limited memory (value = 0):
<property>VirtualMemoryDiagnostics</property>
<value type="long">2</value>
Note: Remove the comment to enable the VirtualMemoryDiagnostics property.
For information about using the rsvpproperties.xml file, see "Advanced Report Processing Configuration Settings" (p. 96).

TM1 + Enterprise Planning, When, Why and How?

This post will be some extracts from a recent PoC, where we made a complex planning system including a rich scenario modeling part. So it was our first big TM1 + EP integration experience.

Some basic definitions:
Cognos Enterprise Planning (aka Adaytum EP) is a very scalable system, all computing is client-side, nice workflow organization, nice GUI (version 8.4 Eclipse one especially) with huge limitations when it comes to the moment of “show me the whole budget in one place” or to serious what-if modeling. But scaling is trivial, each server acts as many clients simultaneously (number of cores\CPUs) and adding more servers scales the system linearly. So to build really scalable systems, we made Contributor only working places, with all analysis done in Cognos 8 BI and Analyst was turned into a modeling tool. In adaytum and cognos 7 times a lot of things(consolidating, what-if) could be done (and to be honest, still can be) in Analyst, but just up the point you reached 40mln cells cube limit in Analyst, then you started dividing cubes and the system became nightmare. Transforming the same consolidation task into series of Contributor applications connected by admin links gave huge performance enhancements, but the "show me the whole budget" limitation was a major problem.
Cognos TM1 (aka Applix TM1) is an in-memory OLAP engine, ultra-speed calculations, server side computing, excel based gui (with web publication), limited workflow capabilities (compared with current EP), scalability limitations (imagine putting servers across whole Russia to ensure response time)

So when it comes to a planning system with large user base – it’s EP, but if some serious modeling and calculations are requied as well – it’s time to fire up TM1 as well.

Overall interaction scheme seems pretty simple:
tm1ep

1) Most of users work in EP inputting budgets, submitting and doing all other workflow related activities
2) After some user actions (saving budget, submitting, accepting it) data is transferred into TM1.
a. Detecting the desired action is easy – we’ve got Event Studio for that (see here and here).
b. Incremental publish is fired and changed elist is republished – that’s pretty fast
c. Then there’s a problem to extract only changed data from publication. That’s the same as with incremental admin links, you just write a simple database procedure that logs last data transfer time and create views showing only recent data (as usual, you want code samples – drop a line)
d. Changed data is bcp’ed\sqlloaded to TM1 server
e. TM1 TurboIntegrator process is fired, loading the extracted data into TM1
3) Analysts work with “live” data in TM1, doing what-if analysis (they dynamically add scenario versions for this purpose), having access to all enterprise budget and actual data.
4) Then a version could be used for top-down propagation and exported into EP (that’s pretty simple, just some writing into EP applications import tables)

The whole system seems pretty healthy, data transfers happens with 1-2 minutes latency (we used Save as trigger action). Doing any kind what-if analysis on a budget version only 2 minutes "stale" with ultra-speed seems very impressive to me. For instance, in that particular PoC the goal was to speed up overall company budget consolidation, including complex allocation and elimination rules. It took over 8 hours in their current system. And only 4 minutes in Tm1 -- imagine all the benefits you can get from that kind of speed.

Since there are more and more rumours about coming TM1+EP bundle, I just hope that step 2 will be more automated. For example, they can track delta xml's sent by contributor client, containing all data updates, instead of publishing and bcping. But I can see no way they can get rid of neccesity of creating 2 models, one in Analyst for Contributor applications and another in TM1. Although dlists\dimensions can be synchronized, calculations are utterly different (you can target specific cube cell in TM1 formula and only the cube slice in EP).

Cognos 8 BI Dashboard Studio

Finally got my hands to installing and trying it.
Well, it looks nice, allows flash-based chart formating and turns Cognos portal pages into more dynamic "dashboards".

But it's strangely slow (tried on a couple of computers) and all in all looks kinda "alpha" and plugged in at last moment. Installation is not that easy too, it requires war building and deployement, procedures that not every BI consultant is aware off.

So I think we should wait for another couple of service packs and there'll be a new standard tool for portal page development. XCelcious should be afraid )

Cognos and MS SQL — happy together

 Correcting myself. I was ranting about MS SQL and Cognos interaction. I was totally wrong.

The problem, described shortly is:

  1. you have 2 databases in MS SQL residing on the same physical server

  2. you create a join “table A from db1 with table B from db2”

  3. Cognos creates two select queries (select * from db1.A) and (select * from db2.B) and then does join locally on server. That’s terribly slow. Cognos should be generating one select query, performing the join on the db server and that’d be really fast.

The answer is simple: there’s no way Cognos can find out that these two databases are on the same physical server. But we can help old fella a bit, setting a datasource property (Content Manager Datasource) the same for both datasources. Therefore, the same datasource prefix will be generated for both tables and they’ll be regarded as residing on the same server. Query speed will increase dramatically.

Morale:  always set the datasource property for MS SQL databases located on the same server. 

Default Framework Manager package publish folder

Just a quick tip -- this setting is stored in "lastPublishCM" property of fm.ini file

Gave me some trouble recently, when language changes led to unappropriate publish folder name. Moreover, we were not able to publish anything at all )

Changing this file helped. Found via FileMonitor from sysinternals, as usual.

Back from winter-sleep

Okay, it has been almost half-a-year (oh, dears) since the last decent post on this blog. Russian one has suffered as well, I must note.

Reasons vary, but mostly it's that I've been, you know, busy-busy. As I now start to reflect on it, it's always a point of view thing and a question of self-control and ability to say no )

But enough philosphy, brief recap on what happend while I was out "there" in real world. I'll divide this into two parts (by vendors ))

Read the rest of this entry »

FireStats icon Powered by FireStats