Quando omni flunkus, mortati. Die dulci fruere.

| Subscribe via RSS

Wednesday, June 10, 2009

Case Expression in Report Studio


Based on a reporting requirement I was asked to present data grouped in year range categories, (e.g. <2000, 2000-2005, 2006-2009, >2009...). The "search case" expression met my objective.

The syntax looks something like this:

WHEN [year] < 2000 THEN ("category 1")
WHEN [year] < 2006 THEN ("category 2")
WHEN [year] < 2009 THEN ("category 3")
WHEN [year] > 2009 THEN ("category 4")


Notice that within the case expression I started with the lessor value (2000) and followed up to the top value. I could have also used an IF ... THEN statement but my feeling is that is it would look quite cluttered.


Robert said...

CASE statements are not available for OLAP Cube sources?