Skip to Content
Personal Insights
Author's profile photo Jan Zwickel

Example 7: allow to display all values without filtering when a certain character (*) is entered

This example is referenced in my other post about input parameters. Please have a look at the other post to get a better understanding of the context for this example

 

Sometimes you would like to allow users to enter a value on which they want to filter a column but at the same time also allow to show all values if the user enters a certain character. How you implement this behavior depends very much on your filter definition.

In the example below it is assumed that

a) the filter is defined as in Example 2:

“product”= ‘$$IP_1$$’

b) the character * is used to indicate that all values should be displayed (no filter should be applied).

 

to reproduce the example:

– take Example 2 and add or ‘$$IP_1$$’ = ‘*’ to the filter:

This means that a record is displayed if either product matches the input parameter value or the input parameter value equals *

 

If you fill into the input parameter:

 

SELECT TOP 1000

“date”,

“product”,

SUM(“productRating”) AS “productRating”,

SUM(“amount”) AS “amount”

FROM “INPUTPARAMETERS_HDI_DB_1”.”inputParameters.db::example7″

    (placeholder.”$$IP_1$$”=>’*’)

GROUP BY “date”, “product”;

 

all values will be displayed:

 

In essence the user can enter a value for which column product should be filtered, or request that all values should be displayed by entering *

 

Click here to navigate back to the context in which this example is discussed. You will also find further examples there.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.