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

How to automatically modify a select case data item ?

Started by sanchoniathon, 17 Mar 2014 08:43:36 AM

Previous topic - Next topic

sanchoniathon

Hi to all,

1- I'm not sure if this is possible and how do we perform this if so

2- We have this Select Case in a Data Item which contains the 12 month of the year as each case statement

3- Every month we have to open the Cognos Report Studio report (version 10.1.1) in design mode and manually indicate a sales amount next to the correct concerned month

4- Here is how the Select Case is set:
CASE [num_mth]
WHEN 1 THEN 10
WHEN 2 THEN 11
WHEN 3 THEN 0
WHEN 4 THEN 0
WHEN 5 THEN 0
WHEN 6 THEN 0
WHEN 7 THEN 0
WHEN 8 THEN 0
WHEN 9 THEN 0
WHEN 10 THEN 0
WHEN 11 THEN 0
WHEN 12 THEN 0
END

5- Which if we are in March, we have to enter a sales number (coming from a confidential paper copy) next to the last completed month (2: February). In our case the amount of 11$

QUESTION:
I know how to use prompts in order to pass the value entered by the user to a specific filter of the query.
But, is it possible to use that same logic to pass the value entered by the user directly in the correct select satement,for example mnext to 'WHEN 3' by using some kind of Report variable or so ??

navissar

Assuming you have 12 months (Which is a very good number of months to have), you could create 12 text prompts and modify your case statement as follows:
case [month]
when 1 then #prompt('month1','integer','0')#
when 2 then #prompt('month2','integer','0')#
...

end

Explanation of the macro expression: #prompt('parameter name','type','default value')#

It is also possible to just prompt for months already past, and not for months that are still to be, but that's a tad more complex.
Does this answer your question?

sanchoniathon

Hi Nimrod,

1- Yes it is a good idea in deed to have 12 months in a year ...
2- This is really good advice you are providing me.
3- But, the thing is that when we run the report, one a month, we want to only prompt for the last completed month wihtout modifying any of the previously entered month values. Is it possible to prompt for the the 12 months but to let the last values entered for the previous month UNTOUCHED ?

Anyhow i'm going to test soon enough your suggestion.

Thanks again for your fast feed-back !

navissar

Data has to come from somewhere. If you don't have it in your database and you don't want to prompt for it, you'll have to change your case statement whenever new data comes...