1

I have a static prompt which is a single select. In that I have two values lets call it A and B. So when I select option 'A' my report pulls all data from the DB which is expected. So when user Select option 'B' the report should pull only the records whose code = 'M'. Here code is a column name in the report.

Note: For option 'A' I don't need to set any prompt in the report because it should pull all records by default.

Girish
  • 49
  • 8
  • I think you're asking how to implement a prompt filter where one choice will filter the response and the other will return all values. The second paragraph seems to state something otherwise. So, basically, can you make it a bit clearer what your question is please. – C'est Moi Aug 03 '20 at 18:34

2 Answers2

1

Let's assume your parameter name is param and data item is named item.

Filter expression:

if (?param? = 'A')
then ([item])
else ('M')
 = [item]

Note: You absolutely need to use a prompt. The result of selecting A should be to not filter.

dougp
  • 2,810
  • 1
  • 8
  • 31
1

I think I understand, try this:

  • Make the prompt a single value (i.e. B) with a use value of 'M'
  • Make the HEADER TEXT for the prompt A (so it is not an actual selection)
  • Make the filter optional

if the user selects A - the prompt is NULL and the optional filter is ignored if the user selects B - the filter [Some data item] = ?YourParm? will occur

Also, if you prefer to not have header text you can make static values A, B and modify the optional filter to be like this:

  • (?YourParm? <> 'M') OR ([Some data item] = ?YourParm?)
VAI Jason
  • 534
  • 4
  • 14