Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
jsimmonstx
Creator
Creator

Match problems

I have a one-record table with the following column:

AppAbbrevs

which is a string that contains the following:

'Field1,Field2,Field3'

When I try MATCH('Field3', ',', AppAbbrevs), it returns 0. It also returns 0 if I surround each value with single quotes.

What am I doing wrong?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

A front-end solution could be like:

=SubStringCount( Left( 'Field1,Field2,Field3', Index('Field1,Field2,Field3' , 'Field3')), ',')+1

Orange - Your field value string

Blue - Search string

Pink - Delimiter

View solution in original post

12 Replies
tresesco
MVP
MVP

May be like this?

MATCH(AppAbbrevs, 'Field3' )

mattquinnterex
Creator II
Creator II

Hi John,

Are you saying that your column has one record, and that record is a string 'Field1,Field2,Field3'?

If so I don't believe the Match() function would work. You should use WildMatch() as that will search through a string.

Match is used to look for a specific string within multiple records, so for example:

     Customer is the column

     record 1: 'A'

     record 2: 'B'

     record 3: 'C'

You would use Match to find customer B for example.

Where as you are wanting to grab part of a big string from one record.

For more on the Match() function, look here: match function in qlikview

And for more on the WildMatch() function, look here: wildmatch - script and chart function ‒ Qlik Sense

The function you would require is: WildMatch(AppAbbrevs, '*Field3*')

Hope this helps, and if you are satisfied with the answer please mark it as correct. If you need further assistance I can help.

jsimmonstx
Creator
Creator
Author

I want the index of the substring within the larger string. Am I using the wrong function?

tresesco
MVP
MVP

Index()?

mattquinnterex
Creator II
Creator II

Hi John, you are looking for this then.

Index(AppAbbrevs, 'Field3')


jsimmonstx
Creator
Creator
Author

I tried that, and it gave me the character index, I want the item index in the delimited string. In the example I provided, I want "3".

Anil_Babu_Samineni

Can you provide sample data and expected result?

Are you talking about this?

Right(FieldName,1)

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)
jsimmonstx
Creator
Creator
Author

I want the INDEX of the substring within the larger delimited string.

In the example I provided, I'm looking for 'Field3', and expecting an index of 3 because 'Field3' is the third delimited item in the string.

Anil_Babu_Samineni

Still confusing, May be this?

If(SunStringCount(FieldName, 'Field3'), '3')

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)