Quickie: Aggregating text in a Cognos crosstab

The ability to show text in a crosstab is highly requested feature. Various work-arounds have been found, such as using layout expressions like: case when [Flag] = 1 then ‘Yes’ else ‘No’ end. This works, but doesn’t allow for truly dynamic crosstabs.

Consider the following requirement. The user wants a crosstab that shows Region, Retailer Type, and a list of Company Names in the intersections. He wants to be able to filter by Product Line to limit the companies that are shown.

aggregating text

In the above example, I’m using DB2. DB2 has the function listagg, which aggregates text with a specified delimitter. Oracle has something similar, group_concat. SQL Server has some UDFs that can do the same thing, such as found here.

This can now be accomplished as of 10.2.1 Fix Pack 3. One of the new features of this fix pack is a way of using non-standard aggregation functions. By prepending “aggregate:” before the function, we are instructing Cognos to trust us that this is an aggragative function. It won’t try to put it in the group by. This makes it incredibly easy to get this effect, the expression in it’s entirety is aggregate:listagg([Sales (query)].[Retailers].[Company name],’, ‘)

aggregating-text.txt (2047 downloads)

#Insight2014 My IBM Insight 2014 Agenda

With the conference only a couple weeks away, it’s time to decide which sessions should be attended. There are a number of goals I’d like to accomplish this year, so I’m planning my schedule accordingly.

With hundreds of sessions, it’s difficult to choose what to see. Different tracks allow you to focus on specific areas, such as “Analytic Business Solutions”, or industry specific sessions like “Energy & Utilities”. The session builder isn’t as easy to use as I’d like, so I set up a spreadsheet to track my sessions on a half hour grain.

Schedule

Every day is jam packed with sessions, events, eating, certification testing, and drinking. As with last year, one of my goals is to collect enough pens to last me another decade. At this rate I won’t need to buy one until at least 2033.

The conference begins officially Saturday night with the Business Partner Reception. It’s essentially a meet and greet with food and light drinks. The sessions begin sunday with the Business Partner Summit Opening General Session, guest speaker Terry Jones.

After the opening session, I’ve elected to go to the following.
1. What’s New in IBM Cognos Business Intelligence 10.2.2 For Applications that Partners Bring to Market – 7143A
I’ve heard so many rumors about the next version, that I’m at the edge of my seat, shivering with antici…pation.

2. IBM Cognos Business Analytics Roadmap and Product Management Panel Discussion – 7144A
Insights into the future!

3. Winning in the Visualization Space – 7106A
IBM is not the leader when it comes to data visualization (Tableau springs to mind), but you can see that they’re working on it. I’ve heard that 10.2.2 has some significant improvements to RAVE.

4. Business Intelligence Competitive Landscape – 7107A
What better place to learn about the competition.

The odd thing is that these sessions are suddenly not appearing in the session finder. I hope they weren’t cancelled, or I’ll feel awfully silly sitting in the rooms.

Monday doesn’t look at busy at first glance, but there’s a lot to pack in.

1. Seize This Moment Envision Your Future – 7070A
The day opens with a general session talking about change and “the transformative of data and analytics”. The description isn’t really seizing my interest, but in my experience the general sessions are always a lot of fun, especially since Grant Imahara will be talking!

2. Advanced Troubleshooting Tools and Special Task Logging in IBM Cognos Business Intelligence – 6956A
This looks very interesting to me. Who hasn’t had to wrestle with Cognos during one of it’s tantrums? Or tried to figure out why Cognos is generating 1.5gig files every hour for the past week? This looks like a great session to start the general conference.

3. IBM Cognos Visualizations with RAVE – 6963A (standby)
I’m kicking myself for not seeing this earlier. I hope there are some no-shows so I can get in. RAVE is an awesome tool, and I love trying to make new graphs. 10.2.2 supposedly has some major improvements, and where better to learn about them than with the designers of the tool themselves? It’s a 5 hour long session. Maybe I can sneak in behind someone or listen in with a cup against the wall.

4. Magic Show by Frank Velasco – Experience the DB2 LUW Performance Magic of DBI and Get 10X ROI – 7142A
I’ll admit, I stay mostly on the reporting side of things, but I have had to deal with stubborn DB2 implementations. And everybody loves magic.

Tuesday looks absolutely packed.

1. Seize This Moment Transform Your Industry – 7071A
This general session is talking about, can you guess, industry transformations. I guess it’s a little too general for me, I prefer the nitty gritty of the actual implementation.

2. Conquering the Average: Leveraging IBM SPSS Software to Unlock the Value of Uncertainty in Your Business – 4841A
This session actually means a great deal to me. One of my longest clients is the Road Safety Authority here in Israel. We’ve finally got the budget for an SPSS license, so seeing what it can do, and how it can do it, will help hopefully help reduce the number of accidents, and lessen the severity of those that occur.

3. Next Generation of IBM Cognos Report Studio – 4289C
I absolutely love these sessions. These are where I get to gripe and complain about all the little things in Report Studio that bother me, and get to give thumbs up to the various ideas they have for improving them. Unfortunately, as with last year, I won’t actually be able to report about them in my blog as I’ll need to sign an NDA. But rest assured, you’re missing out on some awesome upcoming features.

4. Reporting Best Practices Using New Features in IBM Cognos Business Intelligence – 4525A
So now that we’ve learned about some of the new features in Cognos, we’ll learn how to use them properly. It always terrifies me what untrained people can do with Report Studio (even if I am paid to fix the mess later on). From the description, it looks like IBM has been working on ease of report development.

5. New Features in IBM Cognos Business Intelligence Dynamic Query Mode Including Dynamic Cubes – 4872A
I have a long list of features that I hope are included in this.

6. Wow! Did You Do That in IBM Cognos BI Software?? – 4336A
I love showing off what can be done in Cognos, and any chance to see other fancy implementations cannot be missed.

Wednesday is just as busy, with more sessions on implementation and design.

1. Seize This Moment Chart Your Journey – 7072A
Jeff Jonus is an excellent speaker with an incredibly wealth of energy. I suspect he could exhaust my four year old. Any talk he gives will be interesting.

2. Expert Exchange: Designing Effective Visualizations – 7029A
More with RAVE. I am absolutely intent on becoming a RAVEr.

3. Metadata Modeling in IBM Cognos Business Intelligence – 4873A
I’ve taught courses on Framework, so I was almost about to skip this, but this line caught my eye: “It also covers new features that support emerging analytical capabilities.”. My interest is piqued, and I’m looking forward to hearing more.

4. Customizing and Branding Your IBM Cognos Business Intelligence Implementation: Making Cognos BI Your Own – 4608A
The very first article I wrote, many years ago, covered this very topic. Since the introduction of the Theme Designer, customization has become much easier.

5. Expert Exchange: Report Authoring with IBM Cognos Business Intelligence – 7025B
These are fun. Talking with the people in charge of Report Studio. It might give me the chance to ask about some changes I’d like.

6. Case Study: Omnicom Group Upgrades IBM Cognos Platform from Good to Great – 6975A
I know about how my clients work, hearing about others is always interesting. Seeing how other companies solve issues will give me an edge when I inevitably run into them.

And finally, Thursday. My flight leaves late afternoon Thursday, so I wasn’t able to fit in everything I wanted to see. There’s an ESRI session that I want to see, to the extent where I’m thinking about calling Delta to push back my ticket to a later flight.

1. Next Generation Self-Service Business Analytics User Experience for IBM Cognos Solutions – 4402G
This another feedback session covered by an NDA.

2. Expert Exchange: IBM Cognos Mobile – 7037B
I’ll admit that I haven’t had a chance to use Cognos mobile as much as I’d like, but I’d still like to hear what they have to say.

I can think of a few ways, but they involve backups, or third party tools. I wonder if there are other ways.

3. Case Study: Miami-Dade County Uses IBM Cognos Audit Reports and Dashboards to Improve Management – 6885A
Again, seeing how other people implement Cognos will give me more ideas on how to help my clients. Is their implementation succesful? Would their techniques complement my own, or my clients?

4. IBM Cognos Business Intelligence Performance Testing – Tips and Techniques – 4118A
And the last session is all about getting the tool to work. I can’t count the number of times people complain about how slow Cognos can be. Especially when they compare it to local client applications, like Brio.

Unfortunately I need to get to the airport immediately after this session, but had my flights worked out better, I would have stayed to attend the next two.

5. IBM Cognos Business Intelligence and Esri: Unleashing the Power of Geospatial Analytics – 5423A
I’ve had the opportunity to play with the ESRI (remember to spell out each letter, it’s not ehzree) software in the past and I’ve been dumbfounded at the capabilities. ESRI also comes out with a book each year showing off the pretty maps.

6. Case Study: Asian Paints Masters Complex Analytics Environment to Deliver Real-time Insights – 6261A
Another case study. Merging Cognos, TM1, HANA, with RAVE and Active Reports.

There are other sessions that I would love to see, but unfortunately I can’t attend them all. Do you know of any other unmissable sessions? Care to share your agendas?

And finally a personal note. I mentioned before that I am looking for a new position in America. It is my ultimate goal to have a contract signed by the time I board the plane home. I’ll be wandering around the expo each night, badgering the people at all of the booths. If you want to set up a meeting, contact me here or through Event Connect.

Expand and Collapse in Cognos

One of the most requested features in Cognos is expand/collapse feature. At the moment you can expand members in Workspace, but my users find the tool slow and generally difficult to use. There is a JS solution, but it only works in the rows and requires all of the data preloaded. If your data contains thousands of members, this can make the report run slow.

My solution works by passing the member unique name of the current row to a hidden prompt, appending that value to a set, and reordering the set to the natural order. Collapsing the row is a simple matter of removing the member from the prompt. As an added feature, this means you keep the third level visible while hiding the second level.

Expand Collapse

We’ll begin with the query. Each crosstab node refers to three data items. The set, the member unique name, and the count of children.

The set looks like:

#promptmany(
  'ProductsSet'
  ,'mun'
  ,'[sales_and_marketing].[Products].[Products].[Product line]'
  ,'hierarchize(union([sales_and_marketing].[Products].[Products].[Product line],descendants(set('
  ,'[sales_and_marketing].[Products].[Products]'
,'),1)))'
)#

If nothing is selected, it defaults to [sales_and_marketing].[Products].[Products].[Product line]. That can be any valid set expression. If a value is selected, it unions the descendants to the set, and reorders it to the natural order.

The count is:

count(1 within set children(currentMember([sales_and_marketing].[Products].[Products])))

This is to control when the expand button appears. It obviously doesn’t make sense to show the button if there are no children.

The member unique name is simply:

roleValue('_memberUniqueName',[Product line])

The count and mun are added to the properties of the node, so we can refer to them in an HTML expression.

case when [Query1].[PLChildren] = 0 then '' else 

case when ParamDisplayValue('ProductsSet') contains ([Query1].[PLMun])
then '<input type="button" onclick="
paulScripts.removeMunsFromPromptCompat(''Product line'','''+[Query1].[PLMun]+''');
oCR.sendRequest(cognos.Report.Action.FINISH);
"
value="-"
>'
else '<input type="button" onclick="
paulScripts.passMunsToPromptCompat(''Product line'','''+[Query1].[PLMun]+''');
oCR.sendRequest(cognos.Report.Action.FINISH);
"
value="+">'
end
end

If there are no children, then don’t render it. If the member already appears in the parameter, then show the collapse button. Otherwise show the expand button.

This method will also work in previous versions of Cognos if you adapt the JS to work with the old JS API.

expand-collapse.txt (3760 downloads)