COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: rhythmz on 13 Aug 2010 12:17:36 PM

Title: PROMPT: DISPLAY text string value for CHAR(1) DB value in the prompt
Post by: rhythmz on 13 Aug 2010 12:17:36 PM
I would like to create a prompt that USES a column value consisting of one character (i.e. 'S') that I wish to DISPLAY using a text string (i.e. 'Summary') for the one character equivalent in the database. I have been aiming in the direction of a CASE statement and a 2nd Query but am having no luck in getting the prompt to display without an error being thrown.
Title: Re: PROMPT: DISPLAY text string value for CHAR(1) DB value in the prompt
Post by: dlcognos on 16 Aug 2010 06:06:36 AM
In your query for prompt, which has a dataitem returning single character data, add another dataitem and implement it with CASE  WHEN .. END clause.In the comparison, compare the values of the dataitem name and all possible values of single charcter data and within 'THEN' include the description that you would like to have for that single character.

E.g.:
CASE Dataitem1 contain 'C'
THEN 'Correct'
ELSE 'Incorrect'
END :)