Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bhavvibudagam
Creator II
Creator II

how to use wildmatch()

Hi Experts,

I am looking for at what type of scenarios will use the Wild match().

Please provide some complex  scenarios with wild match to under stand this function completely.

Thanks in advance.

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Complex scenarios usually don't make it easier to understand the workings of the WildMatch() function. Let's start with a simple example.

Imagine that you want to create a straight table that shows expression columns based on selections in a list box. E.g. the listbox shows text like 'Actuals', 'Plan', 'Diff', 'Diff %' etc which are all stored in a field called ExpressionSelector.

Now you create a table with all required expressions, but the requirement specifies that a user should be able to turn them on and off. We can get the list of active values in field ExpressionSelector by using the Concat(fieldname, separator) function. However since multiple ExpressionSelector values can be selected at the same time, we can never be sure what the string returned by the Concat function will look like... That's where WildMatch comes in.

The expression

=WildMatch(Concat(ExpressionSelector, ';'), '*Plan*')

will return a non-zero (true) value if and only if the word 'Plan' appears anywhere in the list of active ExpressionSelector values. Note the asterisks, that tell the WildMatch() function that any text can appear both before and after the word 'Plan'.

Now in your Straight Table, this expression can be used in the Conditional Show of the expression that shows Plan values.

Imagine that I leave all values of the ExpressionSelector listbox white (nothing is explicitly selected = everthing is selected), then the Concat(ExpressionSelector, ';') call will return a string like 'Actuals;Plan;Diff;Diff %'. If we use the above expression, it will return a non-zero value because it will find the word 'Plan' in the middle of the string.

That's how WildMatch works.

Best,

Peter

View solution in original post

2 Replies
sunny_talwar

Have you already looked at QlikView/Qlik Sense help? wildmatch - script and chart function ‒ QlikView

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Complex scenarios usually don't make it easier to understand the workings of the WildMatch() function. Let's start with a simple example.

Imagine that you want to create a straight table that shows expression columns based on selections in a list box. E.g. the listbox shows text like 'Actuals', 'Plan', 'Diff', 'Diff %' etc which are all stored in a field called ExpressionSelector.

Now you create a table with all required expressions, but the requirement specifies that a user should be able to turn them on and off. We can get the list of active values in field ExpressionSelector by using the Concat(fieldname, separator) function. However since multiple ExpressionSelector values can be selected at the same time, we can never be sure what the string returned by the Concat function will look like... That's where WildMatch comes in.

The expression

=WildMatch(Concat(ExpressionSelector, ';'), '*Plan*')

will return a non-zero (true) value if and only if the word 'Plan' appears anywhere in the list of active ExpressionSelector values. Note the asterisks, that tell the WildMatch() function that any text can appear both before and after the word 'Plan'.

Now in your Straight Table, this expression can be used in the Conditional Show of the expression that shows Plan values.

Imagine that I leave all values of the ExpressionSelector listbox white (nothing is explicitly selected = everthing is selected), then the Concat(ExpressionSelector, ';') call will return a string like 'Actuals;Plan;Diff;Diff %'. If we use the above expression, it will return a non-zero value because it will find the word 'Plan' in the middle of the string.

That's how WildMatch works.

Best,

Peter