9/2/2023 0 Comments Wildcard union tableau prepTo recap, entering this way a multiple value wildcard search phrase looks like the following:Ĭontains “Phrase 1” AND/OR contains “Phrase 2” AND/OR contains “Phrase 3” AND exclude “Phrase 4” That would be an interesting addition to this solution but for now I kept this simpler. Logical operators are AND / OR though XOR (=exclusive OR) could also be included. Actually, these last 3 parameters are just 2 as I defined the exclusion as always an ‘AND’ on top of the included key phrases. What are the ‘ingredients’ to this exercise? Take 4 string parameters (3 for search phrases to include, 1 to exclude a search phrase) and another 3 parameters to describe the logical operators (connections) between them. It speeds up development and easier to overview from the user’s perspective. There we create separate parameters for every key phrase as well for the logical operators to link them together. So I rejected this route and chose method #2. Moreover, asking the users to remember to a list of special symbols and apply them to compile their search phrase is not exactly user friendly. This process requires very complex string calculations that may hinder performance. Then this expression has to be parsed, also checking the first character of words, ‘registering’ their meaning and if “& / -” are present, trimming them. A search expression like: return every dimension member that contains “Item” AND “32” OR “System” excluding “blue” would be entered like: Item, &32, System, -blue. comma and special characters can indicate the logical relations between them. Search phrases could be separated by e.g. ![]() In method #1 the user is asked to enter all the key phrases as one parameter value. The difference between two available alternatives is how the search phrases are entered. Tableau’s wildcard match value entry can be mimicked by a string parameter and the CONTAINS(string, substring) function is just what we need during the search. – speed and user experience are two key aspects of the software so we keep this in mind ![]() – there are multiple ways to achieve the objective What do we know in advance? We are dealing with Tableau, so: There is a discussion in the Tableau community about applying regular expressions in a wildcard match value but as of now we have to find a different way. The wildcard match options support a single key phrase. As the solution in this post is built on wildcard match logic, let’s check what is already available in Tableau! We at The Information Lab are also committed advocates of Tableau and grab every opportunity to pass on our understanding of the tool. The search logic between them is ‘either-or’. I have found one from Ben Neville who built a custom wildcard match filter with up to three key phrases. ![]() – Full user control on whether the dimension contains ‘all key phrases’, ‘any of them’ or ‘two at the same time or the third one’, via logical operatorsīefore jumping into discussing the execution, we have to be aware that there are already similar solutions around in the community. While Tableau has excellent and flexible filtering capabilities, there is no canned solution for this requirement. Practically think of this exercise as a multiple and customised wildcard match. We recently received a question: is searching for multiple strings in a single dimension while choosing if we wanted an ‘AND’ or ‘OR’ relationship between those items as well as adding a key phrase to exclude from the search. ![]() One of the many great aspects of being a Tableau Consultant is that we can help clients answer challenging questions. 25 May, 2015 Multiple value wildcard search filter in Tableau
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |