If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Help me with this CASE Statement

Started by richiearora, 24 Feb 2011 09:58:22 PM

Previous topic - Next topic

richiearora

Hi team,

I am new to Cognos 8.3 Development.

I am writting an Expression in a Data Item.

CASE WHEN ( [ONLINE]. [Exception Audit Trail]. [Processing Status] = 'P' )
THEN ('Yet to be Processed' )
WHEN ([ONLINE]. [Exception Audit Trail]. [Processing Status] = 'S' )
THEN ('Sucessfully Processed' )
WHEN ( [ONLINE]. [Exception Audit Trail]. [Processing Status] = 'P' )
THEN ('Failed to Process' )


But using this Expression gives Parsing error.

Please help.

Richie

PRIT AMRIT

You have missed out the 'End'

CASE WHEN ( [ONLINE]. [Exception Audit Trail]. [Processing Status] = 'P' )
THEN ('Yet to be Processed' )
WHEN ([ONLINE]. [Exception Audit Trail]. [Processing Status] = 'S' )
THEN ('Sucessfully Processed' )
WHEN ( [ONLINE]. [Exception Audit Trail]. [Processing Status] = 'P' )
THEN ('Failed to Process' )
end

richiearora

Hi ,

I am using this

CASE
WHEN ([Online].[Exception Audit Trail].[Process Status] = 'P' )
THEN ('Yet to be Processed' )
WHEN ( [Online].[Exception Audit Trail].[Process Status]= 'S' )
THEN ('Sucessfully Processed' )
WHEN ( [Online].[Exception Audit Trail].[Process Status]= 'F' )
THEN ('Failed to Process' )
END


Still it gives me error:

Parsing error before or near Position : 84 of: "Case WHEN....."
Parsing text CASE

Shailaja0520

#3
Put the correct  single quotes
'Yet to be Processed'   'Sucessfully Processed'  'Failed to Process'

CASE
WHEN ([Online].[Exception Audit Trail].[Process Status] = 'P' )
THEN ('Yet to be Processed' )
WHEN ( [Online].[Exception Audit Trail].[Process Status]= 'S' )
THEN ('Sucessfully Processed' )
WHEN ( [Online].[Exception Audit Trail].[Process Status]= 'F' )
THEN ('Failed to Process' )
END

Hope it works

PRIT AMRIT

If still getting parsing error then try Like this:

CASE [Online].[Exception Audit Trail].[Process Status]
WHEN 'P'  Then 'Yet to be Processed'
WHEN 'S'  Then 'Successfully Processed'
WHEN 'F'  Then 'Failed to Process'
END

It should DO.

Thanks

richiearora

Thanks prit...it worked perfectly..