Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
manuelrm
Contributor II
Contributor II

Array position

Hello!

I have a problem and I don't know how to solve it with chart functions.

Suppose that I have a field with this possible values:

    John

    Michael

    Rose

    Danny

Then I could use concat( {<Name=>} distinct  [Name] ,',') to have the next value in a text field or function:

     John,Michael,Rose,Danny

Well, I'm looking for a way to show the order of selected item over field Name in that list.

Examples:

     If I select Jhon I want see 1

     If I select Rose I want see 3

Does anybody knows how can I solve this?

Thanks

1 Solution

Accepted Solutions
Nicole-Smith

The match() function returns the number corresponding to a value in a list.  You would write the function something like this:

=match(Name, $(=concat({<Name=>} distinct  chr(39) & [Name]  & chr(39), ',')))

OR

=match('Danny', $(=concat({<Name=>} distinct  chr(39) & [Name]  & chr(39), ',')))

The dollar sign expansion is needed around the concat() so that it just returns the list of values to search over.

View solution in original post

3 Replies
Nicole-Smith

The match() function returns the number corresponding to a value in a list.  You would write the function something like this:

=match(Name, $(=concat({<Name=>} distinct  chr(39) & [Name]  & chr(39), ',')))

OR

=match('Danny', $(=concat({<Name=>} distinct  chr(39) & [Name]  & chr(39), ',')))

The dollar sign expansion is needed around the concat() so that it just returns the list of values to search over.

View solution in original post

Anil_Babu_Samineni

I doubt, whether it will return correct number. I am assume, For Rose Match returns 4 not 3. I haven't check may be it will return 4 only.

Or May be Data island table will work for this case

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
manuelrm
Contributor II
Contributor II
Author

Thanks Nicole! It's fit for my solution