Case statements in Where box

I have read that case statements can be planted in a where clause in SQL, however, Im having trouble getting the Universe parser to pass it.

case FIELDA
when ‘2009’
then
‘ABC’
else
‘ABC’ or ‘MCD’
end

Anyone have an idea on how to get this to work? I am not a brilliant script person. Also, this is in the context of Oracle 10.


Cairmor :us: (BOB member since 2008-06-05)

Hi,

Are you building a predefined condition in a universe (the yellow-funnel condition)?

It needs to have a format of a condition, so it needs to look like this:

case FIELDA
  when '2009' then 'ABC'
  else 'MCD'
end = something

where something is either a hardcoded value or a table column or a prompt ( @prompt() function )


Marek Chladny :slovakia: (BOB member since 2003-11-27)

This is for a dimension object.

I need to let the filter value equal ABC if my FIELDA = 2009

otherwise, the filter value can = ABC or MCD.

awkward, I know.


Cairmor :us: (BOB member since 2008-06-05)

It’s still not clear what you need :crazy_face:

Do you need to create a condition in a universe of this type?

@Select(Class\Dimension Object) = 'ABC' AND FIELDA = 2009 
OR
@Select(Class\Dimension Object) IN ('ABC','MCD')

Marek Chladny :slovakia: (BOB member since 2003-11-27)

Hi Carimor,

Do you mean that a dimension object needs to have a WHERE clause or a filter as you call it ? From what I understand, this is not possible. It could only be a predefined condition as Mark has pointed out.

Thanks,
Sija


sijavarshini (BOB member since 2008-06-11)