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

If condition on prompt value

Started by crazy_tech, 15 Mar 2024 10:09:58 AM

Previous topic - Next topic

crazy_tech

Hi i have a prompt prameter ?TypeofExpense? . I have another dataitem costofExpense .

Now if  ?TypeofExpense?= 'all' then costofExpense should give me cost for TypeofExpense='rent' else costofExpense for choosen TypeofExpense

As i have another dataitems (costs) also..i dont want to apply the filter for those data items

cognostechie

There is a way to do this although selecting 'All' from the prompt and showing values for 'rent' is not a bright idea ! You can add a static value to the Prompt for 'Rent'.

With what you have, you can use a Case statement in the data item costofExpense.

Case
  When ( ?TypeofExpense? = 'All' and [TypeofExpense] = 'rent' )
  Then ( costofExpense )
  Else ( 0 )
End

This presumes that [TypeofExpense] and [costofExpense] are two data items in the same query and the values of both will be present in each row.

dougp

Filters apply to queries, not data items.

Please provide sample inputs and desired outputs.