Author Topic: Problem with CASE Statement  (Read 908 times)

Offline KEKeogh

  • Full Member
  • ***
  • Posts: 30
  • Forum Citizenship: +0/-0
Problem with CASE Statement
« on: 14 Apr 2010 02:47:31 am »
Everything I see says I'm doing this right but I keep getting dashes (--) in the column.

I have the following CASE Statement.

CASE [DSR].[VIEW_APPLN_AVAIL].[APPLICATION_NAME]
WHEN 'ADR' THEN 'Khurana'
WHEN 'Aegon Checkfree' THEN 'Keller'
WHEN 'Avg Cost' THEN 'Khurana'
WHEN 'AWD' THEN 'Khurana'
ELSE 'Unassigned'
END

Aggregate Function = Automatic
Rollup Aggregate Function = Calculated
Column Format = Text

Any help is appreciated.

Kathie

Offline PaulM

  • Global Moderator
  • Statesman
  • *****
  • Posts: 586
  • Forum Citizenship: +81/-1
Re: Problem with CASE Statement
« Reply #1 on: 14 Apr 2010 02:57:54 am »
Aggregate functions will only work with numeric data types, so the rollup aggregate function should be set to automatic or none.

Is this a list or a crosstab?

Offline KEKeogh

  • Full Member
  • ***
  • Posts: 30
  • Forum Citizenship: +0/-0
Re: Problem with CASE Statement
« Reply #2 on: 14 Apr 2010 03:47:58 am »
Sorry I forgot that, it's a crosstab.

Changing the Rollup didn't seem to work either.  Now instead of getting the dashes, each different THEN option came out as a column header.

Offline PaulM

  • Global Moderator
  • Statesman
  • *****
  • Posts: 586
  • Forum Citizenship: +81/-1
Re: Problem with CASE Statement
« Reply #3 on: 14 Apr 2010 03:59:34 am »
This is probably your problem. Are you trying to put this data item into the measures section?

Put it in either the columns or the rows and it should work fine.

Offline KEKeogh

  • Full Member
  • ***
  • Posts: 30
  • Forum Citizenship: +0/-0
Re: Problem with CASE Statement
« Reply #4 on: 14 Apr 2010 08:20:31 pm »
I'm putting it in between the Column headings but still not working.


Offline PaulM

  • Global Moderator
  • Statesman
  • *****
  • Posts: 586
  • Forum Citizenship: +81/-1
Re: Problem with CASE Statement
« Reply #5 on: 19 Apr 2010 12:59:42 pm »
what happens when you put it in the columns? Is it still giving you the '--'? What happens if you put it into a list?

Offline KEKeogh

  • Full Member
  • ***
  • Posts: 30
  • Forum Citizenship: +0/-0
Re: Problem with CASE Statement
« Reply #6 on: 13 May 2010 02:12:38 am »
Not quite sure how I did it but it finally worked.