Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using a comma-separated list of values in Pick() function

Hi there,

I have a LET variable named vList, with the following value:

''Booking Confirmation', 'Container Documentation', 'Document Accuracy', 'Shipper Sent Docs''

As you can see, it's a list of comma separated values where each value is enclosed in single quotes, and finally the whole list is enclosed in single quotes as well.

I want to use this variable in the following expression:

=match(vState, vList)

vState is another variable, its value can be any of the values in the list, and I want to know the position of vState value in the list using the match function. The match() function will be used in an expression in the 'Show Conditional' field in a chart object.

Thing is, I can't get this to work as I expect. I've tried:

=match(vState, vList)    the result is 0

=match(vState, $(vList))  the result is -

Could someone please kindly point me in the right direction?

Thanks in advance,

-Eduardo

1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

Here is the working solution:

Let vList = Chr(39) &'Booking Confirmation' &Chr(39) &',' &Chr(39) &'Container Documentation' &Chr(39)&',' &Chr(39) &'Document Accuracy' &Chr(39)&',' &Chr(39) &'Shipper Sent Docs' &Chr(39);

Let vState= 'Document Accuracy';

In text box:

=Match('$(vState)',$(vList))  <--- This will give you the result 3

Note: Attached is the working qlikview file. Hope this helps...

View solution in original post

5 Replies
sunny_talwar

Do you have a sample you can share?

Colin-Albert

=Match( 'C', 'A', 'B', 'C','D')  returns 3 as you would expect/

Perhaps you need to enclose your first variable in quotes

Have you tried  match('$(vState)', $(vList) )   ?

trdandamudi
Master II
Master II

Here is the working solution:

Let vList = Chr(39) &'Booking Confirmation' &Chr(39) &',' &Chr(39) &'Container Documentation' &Chr(39)&',' &Chr(39) &'Document Accuracy' &Chr(39)&',' &Chr(39) &'Shipper Sent Docs' &Chr(39);

Let vState= 'Document Accuracy';

In text box:

=Match('$(vState)',$(vList))  <--- This will give you the result 3

Note: Attached is the working qlikview file. Hope this helps...

Not applicable
Author

Thanks Thirumala, it worked. The key was to remove the outmost single quotes, as shown by your sample file.

vList value should be

'Booking Confirmation', 'Container Documentation', 'Document Accuracy', 'Shipper Sent Docs'

NOT

''Booking Confirmation', 'Container Documentation', 'Document Accuracy', 'Shipper Sent Docs''

Best Regards,

-Eduardo

trdandamudi
Master II
Master II

I am glad that it worked out....