Page 1 of 1

Set Parameter Value with Data Item

Posted: Mon Jul 02, 2018 2:43 pm
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?

Posted: Mon Jul 02, 2018 4:26 pm
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

Posted: Mon Jul 02, 2018 9:40 pm
by ray.wurlod
Cognos?

Will DSXchange need another forum for Watson, or will it just rename this forum something like IBM BI ?

Posted: Tue Jul 03, 2018 8:06 am
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???

Posted: Tue Jul 03, 2018 3:32 pm
by Mike
Sorry. My bad. Didn't notice the forum.

Mike

Posted: Fri Jul 06, 2018 7:32 am
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.