Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
wunderch
Creator
Creator

Search for whole Word in GetFieldSelections

Hi guys,

I have the following problem:

I have a listbox (DIM) with about 30 values, for example 'WPOO', 'HWGR', 'UWGR', 'WG'.

I want to display a dimension in a chart only if the value in the listbox is selected.

So for the dimension "HWGR" i have tried it with 

=substringcount(Chr(39) & GetFieldSelections(DIM,Chr(39)&','&Chr(39),30) & Chr(39),'HWGR')=1

That works, my problem is, if i do this for "WG" with

=substringcount(Chr(39) & GetFieldSelections(DIM,Chr(39)&','&Chr(39),30) & Chr(39),'WG')=1

the dimension "WG" is shown, even if only "HWGR" is selected.

 

Is there a chance to do this, for example with match or wildmatch?

Thanks for your answers!

Regards 

Chris

 

 

Labels (1)
1 Solution

Accepted Solutions
wunderch
Creator
Creator
Author

Hi Marcus,

thanks for your quick answer. 

Yes i thought about this solution also, but now i got it worked myself with this formula:

substringcount(chr(33)&GetFieldSelections(DIM,Chr(33)&','&chr(33),50)&chr(33),'!WG')=1

View solution in original post

2 Replies
marcus_sommer

You may simplify your approach by using a numeric comparison. Means each dim-value get a number, for example with a dual(string, number) or as an extra field created with recno(), rowno(), autonumber() or further methods. And then the comparison may look like: max(Dim) = 5

- Marcus

wunderch
Creator
Creator
Author

Hi Marcus,

thanks for your quick answer. 

Yes i thought about this solution also, but now i got it worked myself with this formula:

substringcount(chr(33)&GetFieldSelections(DIM,Chr(33)&','&chr(33),50)&chr(33),'!WG')=1