Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
pepe2209
Creator
Creator

show if value is present in string

Hello

i have the following table

ClientCharts
A1,2,3
B1,2
C1,3

The string within the charts-field refers to the charts that should be visible per client.

So for chart one i want to have a conditional show if the value 1 is present in the string.

chart two for value 2

chart three for value 3 etc.

what is the most effective way to identify if a value is part of a larger string?

your help would be much appreciated.

Kind regards,

Peter

Labels (1)
1 Solution

Accepted Solutions
Not applicable

Just add in your delimiter to ensure the proper match?

Index([Your string here]&',','1,')>0

Index([Your string here]&',','11,')>0

Edit: need to add the comma at the end to make sure last one is picked up

View solution in original post

8 Replies
Not applicable

Hi Peter,

Index should do the job for you

Index([Your string here],'1')>0 for instance

hope that helps

Joe

Anonymous
Not applicable

if ( index ([Charts] , '2' ) > 0 , .......................

Not applicable

Hi Pete

U can use Match(), Mixmatch() or WildMatch() depending on the way u wanna search your string. All 3 can be found I the help menu.

/ Teis

pepe2209
Creator
Creator
Author

Thanks but it is not the complete solution.

Because the string can go up to 11,12, etc. So with the following string: 3,8,11 it will still identify '1' in '11'.

Not applicable

Just add in your delimiter to ensure the proper match?

Index([Your string here]&',','1,')>0

Index([Your string here]&',','11,')>0

Edit: need to add the comma at the end to make sure last one is picked up

pepe2209
Creator
Creator
Author

thanks Joe!

I only needed a comma at the start to or else it will still identify '1,' in '11,'

so now it is:

Index(','&[Your string here]&',', ',1,')

Index(','&[Your string here]&',', ',11,')

Anonymous
Not applicable

Try 1s and 0s.

A 111

B 110

C 101

And then use string functions like mid() to determine.

BR

Serhan

Not applicable

good point sorry yea forgot that one!