Objective: Users should be able to search by entering the text (in all UPPER/lower case) and
view results.
view results.
To achieve this functionality we need to create a dashboard prompt, analysis and apply the filters using Case Conversion functions (Lower, Upper) as below.
1) Create a new dashabord prompt and select column prompt from the list.
- Select Text Field for User Input
- Select the type of variable as Presentation Variable, enter a name for the variable as "company_name".
- Save the prompt.
Dashboard Prompt - Text Field |
2) Create an analysis and add coulmns to the criteria
- Edit the column filter and from the “Add More Options” list, select Presentation Variable. In the variable expresssion, enter the presentation variable name as company_name.
- Using the Advanced SQL Filter, you can convert this filter to SQL and edit the filter to apply LOWER or UPPER functions.
- Apply condition below, for a column where data in the column contains all of the values in the filter.
UPPER("Offices"."D4 Company") like UPPER('%@{company_name}{%}%')
or
UPPER("Offices"."D4 Company") like UPPER('%@{company_name}%') - display no results message in the dashboard.
or
UPPER("Offices"."D4 Company") like UPPER('%@{company_name}%') - display no results message in the dashboard.
- Similarly, for a column where the data in the column begins with the value in the filter, apply the condition below.
UPPER("Offices"."D4 Company") like UPPER('@{company_name}%')
Report Filter |
Filter SQL |
3) Finally when a user searches a company regardless of the case
(lower/upper), content of the presentation variable and SQL filter applied in
the analysis makes the comparison and provide the results.
Lower case search |
Upper case Search |
This seems to require the user to enter a value for Company Name, or no results are returned. Is it possible to make the prompt optional in addition to case insensitive?
ReplyDeleteYes, it is possible to show report results without entering any value. Also, users can search a company regardless of the case (lower/upper) and view results.
DeleteEdit your prompt, uncheck "Requires User Input" in Options section and save. You should be able to view results for all companies.
Keep posting if you have any comments/questions.
Edit your prompt and make Default Selection as
DeleteSpecific Value = % then you should be able to view all results without entering any prompt value.
Hey, thanks for viewing my blog.
ReplyDeleteIn my scenario, the report should not diplay results until user enter the Company Name. Sure, I'll try your scenario and keep you posted.
This comment has been removed by the author.
ReplyDeleteWhat if the prompt and criteria are already created? Can I still go in and make the last and first name prompt case insensitive? I want users to be able to enter a students name lower or upper case and it renders a result without an error message.
ReplyDelete