Set Parameter Value with Data Item

This forum is the beginning of our inclusion of Cognos users to have their own place to go within our community. It is said the ETL and BI don't intersect, but as IBM integrates their platforms, there are less lines of demarcation between the two.

Moderators: chulett, rschirm

Post Reply
jackson.eyton
Premium Member
Premium Member
Posts: 143
Joined: Thu Oct 26, 2017 10:43 am

Set Parameter Value with Data Item

Post by jackson.eyton »

Hi, I was curious about setting a parameter value using a Data Item. I have a report that I have created a Data Item that uses a CASE WHEN condition to try and set the value of ?myParam? parameter. Then a Filter set on [My Field] > ?myParam? for example. This is an optional filter so if the CASE WHEN doesn't assign a value to the parameter then the filter will not apply. It appears that its never assigning the value to the parameter. Here is an example of the Data Item Expression that is supposed to set the parameter value:
CASE
WHEN (?Param1? = 'X') THEN (NULL)
WHEN (?Param1? = 'Y') THEN (?myParam? = 45)
ELSE (NULL)
END

The optional filter is:
[myField] > ?myParam?
-Me
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm

Post by Mike »

A job can not modify its own parameters. They are set when the job begins executing. The usual technique is to use a separate job/routine/command to derive the required parameters and then pass them to the job that needs them.

There should be lots of discussion about the various techniques. Since you're using a server job, the user status property is very handy.

Mike
ray.wurlod
Participant
Posts: 54588
Joined: Wed Oct 23, 2002 10:52 pm

Post by ray.wurlod »

Cognos?

Will DSXchange need another forum for Watson, or will it just rename this forum something like IBM BI ?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jackson.eyton
Premium Member
Premium Member
Posts: 143
Joined: Thu Oct 26, 2017 10:43 am

Post by jackson.eyton »

Mike,
I think our wires are crossed, or I am misunderstanding. I am referring to Cognos reports. In any case I think I found a way around what I was trying to do, many ways to skin the cat thankfully. I will update this again once I have confirmed my idea.

Ray,
I have no idea???
-Me
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm

Post by Mike »

Sorry. My bad. Didn't notice the forum.

Mike
jackson.eyton
Premium Member
Premium Member
Posts: 143
Joined: Thu Oct 26, 2017 10:43 am

Post by jackson.eyton »

I did in fact get a work around for this functioning. Basically I have a report that has a prompt to run one of a selection of report pages. The report pages use the same query but with different filters. In this case I made a report to use flag, then made the report requirements (Balance < X for report 1, and Days OD > Y for report 2) a flag as well. Each row then has a flag for which report it belongs in and these are concatenated as rows can belong to one or both reports. Then the filter is set to only show rows that have their report selected flag value in the report belongs to flag. These flags are all hidden from the report output of course.
-Me
Post Reply