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
"date",
"product",
SUM("productRating") AS "productRating",
SUM("amount") AS "amount"
FROM "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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
15 | |
15 | |
13 | |
11 | |
11 | |
9 | |
8 | |
7 | |
7 | |
7 |